我想知道一个 mrjob 程序运行了多长时间。但是,unindent does not match any outer indentation level
如果我在time.time()
before 和 after中输入,我会得到一个错误MRWord.run()
,并且我找不到任何关于此的文档。我错过了什么?
from mrjob.job import MRJob
class MRWord(MRJob):
def mapper(self, _, line):
x = line.split()
yield x[0], 1
def reducer(self, word, counts):
yield word, sum(counts)
if __name__ == '__main__':
t0 = time.time()
MRWord.run()
print time.time() - t0