| 403 | timestamp = None |
| 404 | |
| 405 | def do_checks(): |
| 406 | if bucket != float('+Inf'): |
| 407 | raise ValueError("+Inf bucket missing: " + name) |
| 408 | if count is not None and value != count: |
| 409 | raise ValueError("Count does not match +Inf value: " + name) |
| 410 | if has_sum and count is None: |
| 411 | raise ValueError("_count must be present if _sum is present: " + name) |
| 412 | if has_gsum and count is None: |
| 413 | raise ValueError("_gcount must be present if _gsum is present: " + name) |
| 414 | if not (has_sum or has_gsum) and count is not None: |
| 415 | raise ValueError("_sum/_gsum must be present if _count is present: " + name) |
| 416 | if has_negative_buckets and has_sum: |
| 417 | raise ValueError("Cannot have _sum with negative buckets: " + name) |
| 418 | if not has_negative_buckets and has_negative_gsum: |
| 419 | raise ValueError("Cannot have negative _gsum with non-negative buckets: " + name) |
| 420 | |
| 421 | for s in samples: |
| 422 | suffix = s.name[len(name):] |