OLD | NEW |
1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 """Report ts_mon metrics for HTTP requests made by the `requests` library. | 5 """Report ts_mon metrics for HTTP requests made by the `requests` library. |
6 | 6 |
7 This module provides get(), post(), etc. methods that wrap the corresponding | 7 This module provides get(), post(), etc. methods that wrap the corresponding |
8 methods in the requests module. They take an additional first 'name' argument | 8 methods in the requests module. They take an additional first 'name' argument |
9 which is an identifier for the type of request being made. | 9 which is an identifier for the type of request being made. |
10 | 10 |
11 Example:: | 11 Example:: |
12 | 12 |
13 from infra_libs import instrumented_requests | 13 from infra_libs import instrumented_requests |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 | 88 |
89 request = functools.partial(_wrap, 'request') | 89 request = functools.partial(_wrap, 'request') |
90 get = functools.partial(_wrap, 'get') | 90 get = functools.partial(_wrap, 'get') |
91 head = functools.partial(_wrap, 'head') | 91 head = functools.partial(_wrap, 'head') |
92 post = functools.partial(_wrap, 'post') | 92 post = functools.partial(_wrap, 'post') |
93 patch = functools.partial(_wrap, 'patch') | 93 patch = functools.partial(_wrap, 'patch') |
94 put = functools.partial(_wrap, 'put') | 94 put = functools.partial(_wrap, 'put') |
95 delete = functools.partial(_wrap, 'delete') | 95 delete = functools.partial(_wrap, 'delete') |
96 options = functools.partial(_wrap, 'options') | 96 options = functools.partial(_wrap, 'options') |
OLD | NEW |