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

Side by Side Diff: tracing/tracing/value/add_revision_info.py

Issue 2990293002: Revision Info into GenericSet (Closed)
Patch Set: Address Ben's comments Created 3 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
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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
eakuefner 2017/08/08 21:18:15 Delete this file.
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 from tracing.value import histogram
6 import tempfile 6 from tracing.value.diagnostics import reserved_infos
7 7
8 from tracing.value import add_shared_diagnostic 8 def AddRevisionInfo(histogram_set, chromium_commit, chromium_revisions,
9 9 v8_commit, v8_revisions, catapult, angle, skia, webrtc):
10 def AddRevisionInfo(histograms_json_filename, chromium, v8, catapult, angle, 10 """Adds a shared diagnostics containing pieces of revision information to a
11 skia, webrtc): 11 HistogramSet.
12 """
12 revision_info = { 13 revision_info = {
13 'chromium': chromium, 14 reserved_infos.CHROMIUM_REVISIONS.name: chromium_revisions,
14 'v8': v8, 15 reserved_infos.CHROMIUM_COMMIT_POSITIONS.name: [chromium_commit],
15 'catapult': catapult, 16 reserved_infos.V8_REVISIONS.name: v8_revisions,
16 'angle': angle, 17 reserved_infos.V8_COMMIT_POSITIONS.name: [v8_commit],
17 'skia': skia, 18 reserved_infos.CATAPULT_REVISIONS.name: catapult,
18 'webrtc': webrtc, 19 reserved_infos.ANGLE_REVISIONS.name: angle,
20 reserved_infos.SKIA_REVISIONS.name: skia,
21 reserved_infos.WEBRTC_REVISIONS.name: webrtc,
19 } 22 }
20 23
21 with tempfile.NamedTemporaryFile() as diagnostic_file: 24 for revision_info_name, revision_info_value in revision_info.iteritems():
22 json.dump(revision_info, diagnostic_file) 25 histogram_set.AddSharedDiagnostic(
23 return add_shared_diagnostic.AddSharedDiagnostic( 26 revision_info_name, histogram.GenericSet(revision_info_value))
24 histograms_json_filename, 'revisions', diagnostic_file.name)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698