MCPcopy Create free account
hub / github.com/apache/impala / split_timestamp

Function split_timestamp

docker/monitor.py:91–101  ·  view source on GitHub ↗

Parses timestamp at beginning of a line. Returns a tuple of seconds since the epoch and the rest of the line. Returns None on parse failures.

(line)

Source from the content-addressed store, hash-verified

89
90
91def split_timestamp(line):
92 """Parses timestamp at beginning of a line.
93
94 Returns a tuple of seconds since the epoch and the rest
95 of the line. Returns None on parse failures.
96 """
97 LENGTH = 26
98 FORMAT = "%Y-%m-%d %H:%M:%S.%f"
99 t = line[:LENGTH]
100 return (datetime_to_seconds_since_epoch(datetime.datetime.strptime(t, FORMAT)),
101 line[LENGTH + 1:])
102
103
104class ContainerMonitor(object):

Callers 2

logfile_timelineMethod · 0.85
parse_metricsMethod · 0.85

Calls 1

Tested by

no test coverage detected