blob: 1f77b4b7131ce009df33f379507ac95e1c48dcbe [file] [log] [blame]
Jian Li65f5aa22016-03-22 11:49:42 -07001/*
2 * Copyright 2016 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.influxdbmetrics;
17
18import org.joda.time.DateTime;
19
20/**
21 * Metric that represents all values queried from influx database.
22 */
23public interface InfluxMetric {
24
25 /**
26 * Returns one minute rate of the given metric.
27 *
28 * @return one minute rate of the given metric
29 */
30 double oneMinRate();
31
32
33 /**
34 * Returns collected timestamp of the given metric.
35 *
36 * @return collected timestamp of the given metric
37 */
38 DateTime time();
39
40 /**
41 * A builder of InfluxMetric.
42 */
43 interface Builder {
44
45 /**
46 * Sets one minute rate.
47 *
48 * @param rate one minute rate
49 * @return builder object
50 */
51 Builder oneMinRate(double rate);
52
53 /**
54 * Sets collected timestamp.
55 *
56 * @param time timestamp
57 * @return builder object
58 */
59 Builder time(String time);
60
61 /**
62 * Builds a influx metric instance.
63 *
64 * @return influx metric instance
65 */
66 InfluxMetric build();
67 }
68}