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

Side by Side Diff: infra_libs/ts_mon/interface.py

Issue 1296863003: Reduce the number of MetricsData protos to put in each request. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix the test Created 5 years, 4 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 | « no previous file | infra_libs/ts_mon/test/interface_test.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 """Classes representing the monitoring interface for tasks or devices. 5 """Classes representing the monitoring interface for tasks or devices.
6 6
7 Usage: 7 Usage:
8 import argparse 8 import argparse
9 from infra_libs import ts_mon 9 from infra_libs import ts_mon
10 10
(...skipping 25 matching lines...) Expand all
36 import random 36 import random
37 import threading 37 import threading
38 import time 38 import time
39 39
40 from monacq.proto import metrics_pb2 40 from monacq.proto import metrics_pb2
41 41
42 from infra_libs.ts_mon import errors 42 from infra_libs.ts_mon import errors
43 43
44 # The maximum number of MetricsData messages to include in each HTTP request. 44 # The maximum number of MetricsData messages to include in each HTTP request.
45 # MetricsCollections larger than this will be split into multiple requests. 45 # MetricsCollections larger than this will be split into multiple requests.
46 METRICS_DATA_LENGTH_LIMIT = 5000 46 METRICS_DATA_LENGTH_LIMIT = 1000
47 47
48 48
49 class State(object): 49 class State(object):
50 """Package-level state is stored here so that it is easily accessible. 50 """Package-level state is stored here so that it is easily accessible.
51 51
52 Configuration is kept in this one object at the global level so that all 52 Configuration is kept in this one object at the global level so that all
53 libraries in use by the same tool or service can all take advantage of the 53 libraries in use by the same tool or service can all take advantage of the
54 same configuration. 54 same configuration.
55 """ 55 """
56 56
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 'Last monitoring flush took %f seconds (longer than ' 176 'Last monitoring flush took %f seconds (longer than '
177 '--ts-mon-flush-interval-secs = %f seconds)', 177 '--ts-mon-flush-interval-secs = %f seconds)',
178 flush_duration, self.interval_secs) 178 flush_duration, self.interval_secs)
179 next_timeout = 0 179 next_timeout = 0
180 180
181 def stop(self): 181 def stop(self):
182 """Stops the background thread and performs a final flush.""" 182 """Stops the background thread and performs a final flush."""
183 183
184 self.stop_event.set() 184 self.stop_event.set()
185 self.join() 185 self.join()
OLDNEW
« no previous file with comments | « no previous file | infra_libs/ts_mon/test/interface_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698