OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging | 5 import logging |
6 | 6 |
7 from infra.libs.event_mon.chrome_infra_log_pb2 import ChromeInfraEvent | 7 from infra.libs.event_mon.chrome_infra_log_pb2 import ChromeInfraEvent |
8 from infra.libs.event_mon.chrome_infra_log_pb2 import ServiceEvent | 8 from infra.libs.event_mon.chrome_infra_log_pb2 import ServiceEvent |
9 from infra.libs.event_mon.log_request_lite_pb2 import LogRequestLite | 9 from infra.libs.event_mon.log_request_lite_pb2 import LogRequestLite |
10 from infra.libs.event_mon import config, router | 10 from infra.libs.event_mon import config, router |
(...skipping 23 matching lines...) Expand all Loading... | |
34 % str(type(event_timestamp))) | 34 % str(type(event_timestamp))) |
35 return False | 35 return False |
36 | 36 |
37 event = ChromeInfraEvent() | 37 event = ChromeInfraEvent() |
38 event.CopyFrom(config.cache['default_event']) | 38 event.CopyFrom(config.cache['default_event']) |
39 event.service_event.type = getattr(ServiceEvent, event_type) | 39 event.service_event.type = getattr(ServiceEvent, event_type) |
40 | 40 |
41 if timestamp_kind: | 41 if timestamp_kind: |
42 event.timestamp_kind = getattr(ChromeInfraEvent, timestamp_kind) | 42 event.timestamp_kind = getattr(ChromeInfraEvent, timestamp_kind) |
43 | 43 |
44 # TODO: Serialize protobuf here. | 44 # TODO: Serialize protobuf here. |
Sergey Berezin
2015/02/07 03:16:47
nit: stale TODO.
pgervais
2015/02/10 10:36:37
Done.
| |
45 log_event = LogRequestLite.LogEventLite() | 45 log_event = LogRequestLite.LogEventLite() |
46 log_event.event_time_ms = event_timestamp or router.time_ms() | 46 log_event.event_time_ms = event_timestamp or router.time_ms() |
47 log_event.source_extension = event.SerializeToString() | |
47 return config._router.push_event(log_event) | 48 return config._router.push_event(log_event) |
OLD | NEW |