Esempio n. 1
0
 def test_counter_metric_failure(self):
     """Test counter metric failure."""
     self.mock.check_module_loaded.return_value = False
     counter = monitor.CounterMetric('t',
                                     'desc',
                                     field_spec=[
                                         monitor.StringField('name'),
                                     ])
     counter.increment()
     counter.increment({'name': 'test'})
     counter.increment_by(5)
     self.assertIsInstance(counter, monitor._MockMetric)
Esempio n. 2
0
 def test_counter_metric_success(self):
     self.assertIsInstance(
         monitor.CounterMetric('t', 'desc', field_spec=None),
         monitor._CounterMetric)
Esempio n. 3
0
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Metrics. All metrics should go into this file."""

from metrics import monitor

# Fuzz task metrics.
BIG_QUERY_WRITE_COUNT = monitor.CounterMetric(
    'debug/big_query/write_count',
    description='The number of BigQuery writes',
    field_spec=[
        monitor.BooleanField('success'),
    ])

JOB_BAD_BUILD_COUNT = monitor.CounterMetric(
    'task/fuzz/job/bad_build_count',
    description=("Count of fuzz task's bad build count "
                 '(grouped by job type)'),
    field_spec=[
        monitor.StringField('job'),
        monitor.BooleanField('bad_build'),
    ])

FUZZER_KNOWN_CRASH_COUNT = monitor.CounterMetric(
    'task/fuzz/fuzzer/known_crash_count',
    description=('Count of fuzz task\'s known crash count '