Chromium Code Reviews| Index: scripts/slave/recipes/infra/git_hash_metric.py |
| diff --git a/scripts/slave/recipes/infra/git_hash_metric.py b/scripts/slave/recipes/infra/git_hash_metric.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6ddbef1a4cc61976af211147c197ad83de516d77 |
| --- /dev/null |
| +++ b/scripts/slave/recipes/infra/git_hash_metric.py |
| @@ -0,0 +1,32 @@ |
| +from recipe_engine.recipe_api import Property |
| + |
| +DEPS = [ |
| + 'recipe_engine/properties', |
| + 'recipe_engine/python', |
| +] |
| + |
| + |
| +def RunSteps(api): |
| + git_revision = api.properties['git_revision'] |
| + repository = api.properties['repository'] |
| + |
| + api.python( |
| + 'send hash to ts_mon', |
| + '/opt/infra-python/run.py', |
| + ['infra.tools.send_ts_mon_values', |
| + '--verbose', |
| + '--ts-mon-target-type=task', |
| + '--ts-mon-task-service-name=git_hash_metric', |
| + ('--gauge=\'{"name":"repository/hash", ' |
|
Sergey Berezin
2016/04/18 17:22:45
You want --string.
|
| + '"value": "%s", "repository": "%s"}\'' % (git_revision, repository)), |
| + ] |
| + ) |
| + |
| + |
| +def GenTests(api): |
| + yield (api.test('infra') + |
| + api.properties.git_scheduled( |
| + git_revision='deadbeefdeadbeefdeadbeefdeadbeefdeadbeef', |
| + repository='https://chromium.googlesource.com/infra/infra' |
| + ) |
| + ) |