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

Side by Side Diff: client/third_party/infra_libs/experiments.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Created 4 years, 6 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 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 # that can be found in the LICENSE file.
4 4
5 """Tools for gradually enabling a feature on a deterministic set of machines. 5 """Tools for gradually enabling a feature on a deterministic set of machines.
6 6
7 Add a flag to your program to control the percentage of machines that a new 7 Add a flag to your program to control the percentage of machines that a new
8 feature should be enabled on:: 8 feature should be enabled on::
9 9
10 def add_argparse_options(self, parser): 10 def add_argparse_options(self, parser):
11 parser.add_argument('--myfeature-percent', type=int, default=0) 11 parser.add_argument('--myfeature-percent', type=int, default=0)
12 12
13 def main(self, opts): 13 def main(self, opts):
(...skipping 22 matching lines...) Expand all
36 def is_active_for_host(experiment_name, percent): 36 def is_active_for_host(experiment_name, percent):
37 ret = _is_active({ 37 ret = _is_active({
38 'name': experiment_name, 38 'name': experiment_name,
39 'host': socket.getfqdn(), 39 'host': socket.getfqdn(),
40 }, percent) 40 }, percent)
41 41
42 if ret: 42 if ret:
43 logging.info('Experiment "%s" is active', experiment_name) 43 logging.info('Experiment "%s" is active', experiment_name)
44 44
45 return ret 45 return ret
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698