GRPC Core 0.10.0.0

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
histogram.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright 2015, Google Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above
13 * copyright notice, this list of conditions and the following disclaimer
14 * in the documentation and/or other materials provided with the
15 * distribution.
16 * * Neither the name of Google Inc. nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
34 #ifndef GRPC_SUPPORT_HISTOGRAM_H
35 #define GRPC_SUPPORT_HISTOGRAM_H
36
37 #include <grpc/support/port_platform.h>
38 #include <stddef.h>
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 typedef struct gpr_histogram gpr_histogram;
45
46 gpr_histogram *gpr_histogram_create(double resolution, double max_bucket_start);
47 void gpr_histogram_destroy(gpr_histogram *h);
48 void gpr_histogram_add(gpr_histogram *h, double x);
49
50 /* The following merges the second histogram into the first. It only works
51 if they have the same buckets and resolution. Returns 0 on failure, 1
52 on success */
53 int gpr_histogram_merge(gpr_histogram *dst, gpr_histogram *src);
54
55 double gpr_histogram_percentile(gpr_histogram *histogram, double percentile);
56 double gpr_histogram_mean(gpr_histogram *histogram);
57 double gpr_histogram_stddev(gpr_histogram *histogram);
58 double gpr_histogram_variance(gpr_histogram *histogram);
59 double gpr_histogram_maximum(gpr_histogram *histogram);
60 double gpr_histogram_minimum(gpr_histogram *histogram);
61 double gpr_histogram_count(gpr_histogram *histogram);
62 double gpr_histogram_sum(gpr_histogram *histogram);
63 double gpr_histogram_sum_of_squares(gpr_histogram *histogram);
64
65 const gpr_uint32 *gpr_histogram_get_contents(gpr_histogram *histogram,
66 size_t *count);
67 void gpr_histogram_merge_contents(gpr_histogram *histogram,
68 const gpr_uint32 *data, size_t data_count,
69 double min_seen, double max_seen, double sum,
70 double sum_of_squares, double count);
71
72 #ifdef __cplusplus
73 }
74 #endif
75
76 #endif /* GRPC_SUPPORT_HISTOGRAM_H */
port_platform.h
gpr_histogram_sum
double gpr_histogram_sum(gpr_histogram *histogram)
gpr_histogram_minimum
double gpr_histogram_minimum(gpr_histogram *histogram)
gpr_histogram_variance
double gpr_histogram_variance(gpr_histogram *histogram)
gpr_uint32
uint32_t gpr_uint32
Definition: port_platform.h:309
gpr_histogram_merge
int gpr_histogram_merge(gpr_histogram *dst, gpr_histogram *src)
gpr_histogram_merge_contents
void gpr_histogram_merge_contents(gpr_histogram *histogram, const gpr_uint32 *data, size_t data_count, double min_seen, double max_seen, double sum, double sum_of_squares, double count)
gpr_histogram_maximum
double gpr_histogram_maximum(gpr_histogram *histogram)
gpr_histogram_mean
double gpr_histogram_mean(gpr_histogram *histogram)
gpr_histogram_create
gpr_histogram * gpr_histogram_create(double resolution, double max_bucket_start)
gpr_histogram_sum_of_squares
double gpr_histogram_sum_of_squares(gpr_histogram *histogram)
gpr_histogram_count
double gpr_histogram_count(gpr_histogram *histogram)
gpr_histogram
struct gpr_histogram gpr_histogram
Definition: histogram.h:44
gpr_histogram_add
void gpr_histogram_add(gpr_histogram *h, double x)
gpr_histogram_destroy
void gpr_histogram_destroy(gpr_histogram *h)
gpr_histogram_stddev
double gpr_histogram_stddev(gpr_histogram *histogram)
gpr_histogram_percentile
double gpr_histogram_percentile(gpr_histogram *histogram, double percentile)
gpr_histogram_get_contents
const gpr_uint32 * gpr_histogram_get_contents(gpr_histogram *histogram, size_t *count)