Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: infra/libs/event_mon/monitoring.py

Issue 875403010: event_mon: actually implemented push (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebased + fixed nits Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « infra/libs/event_mon/config.py ('k') | infra/libs/event_mon/router.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
45 log_event = LogRequestLite.LogEventLite() 44 log_event = LogRequestLite.LogEventLite()
46 log_event.event_time_ms = event_timestamp or router.time_ms() 45 log_event.event_time_ms = event_timestamp or router.time_ms()
46 log_event.source_extension = event.SerializeToString()
47 return config._router.push_event(log_event) 47 return config._router.push_event(log_event)
OLDNEW
« no previous file with comments | « infra/libs/event_mon/config.py ('k') | infra/libs/event_mon/router.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698