You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Alex Amato (Jira)" <ji...@apache.org> on 2021/04/06 18:46:00 UTC

[jira] [Updated] (BEAM-12103) HistogramCell needs a few touches to make it match the spec :)

     [ https://issues.apache.org/jira/browse/BEAM-12103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Amato updated BEAM-12103:
------------------------------
    Description: 
See spec here:

 __ [_https://s.apache.org/beam-histogram-metrics_]

A few pieces I want to highlight:

  *//   LINEAR(start, width, num_buckets):*

  *//       Bi = start + width * i*

  *//       e.g. LINEAR(5, 15, 6) defines:*

  *//           [-INF, 5), [5, 20), [20, 35), [35, 50), [50, 65), [65, +INF], ...*

Current Java implementation:

LinearBuckets.of(5, 15, 6) will defined buckets like this (6 buckets excluding the infinite ranges)

[-INF, 5), [5, 20), [20, 35), [35, 50), [50, 65), [65, 80), [80, 95), [95, +INF], ...

 

Additionally, we should treat the infinite buckets like any other, i.e. as a counter in the array, rather than having separate variables for the -inf and inf buckets.:

i.e. we can remove numTopRecords numBottomRecords

public HistogramData(BucketType bucketType) {
 this.bucketType = bucketType;
 this.buckets = new long[bucketType.getNumBuckets()];
 this.numOfRecords = 0;
 this.numTopRecords = 0;
 this.numBottomRecords = 0;
}

 

 

  was:
See spec here:

 __ [_https://s.apache.org/beam-histogram-metrics_]

A few pieces I want to highlight:

  *//   LINEAR(start, width, num_buckets):*

  *//       Bi = start + width * i*

  *//       e.g. LINEAR(5, 15, 6) defines:*

  *//           [-INF, 5), [5, 20), [20, 35), [35, 50), [50, 65), [65, +INF], ...*

Current Java implementation:

LinearBuckets.of(5, 15, 6) will defined buckets like this (6 buckets excluding the infinite ranges)

[-INF, 5), [5, 20), [20, 35), [35, 50), [50, 65), [65, 80), [80, 95), [95, +INF], ...

 


> HistogramCell needs a few touches to make it match the spec :)
> --------------------------------------------------------------
>
>                 Key: BEAM-12103
>                 URL: https://issues.apache.org/jira/browse/BEAM-12103
>             Project: Beam
>          Issue Type: Test
>          Components: java-fn-execution
>            Reporter: Alex Amato
>            Priority: P2
>
> See spec here:
>  __ [_https://s.apache.org/beam-histogram-metrics_]
> A few pieces I want to highlight:
>   *//   LINEAR(start, width, num_buckets):*
>   *//       Bi = start + width * i*
>   *//       e.g. LINEAR(5, 15, 6) defines:*
>   *//           [-INF, 5), [5, 20), [20, 35), [35, 50), [50, 65), [65, +INF], ...*
> Current Java implementation:
> LinearBuckets.of(5, 15, 6) will defined buckets like this (6 buckets excluding the infinite ranges)
> [-INF, 5), [5, 20), [20, 35), [35, 50), [50, 65), [65, 80), [80, 95), [95, +INF], ...
>  
> Additionally, we should treat the infinite buckets like any other, i.e. as a counter in the array, rather than having separate variables for the -inf and inf buckets.:
> i.e. we can remove numTopRecords numBottomRecords
> public HistogramData(BucketType bucketType) {
>  this.bucketType = bucketType;
>  this.buckets = new long[bucketType.getNumBuckets()];
>  this.numOfRecords = 0;
>  this.numTopRecords = 0;
>  this.numBottomRecords = 0;
> }
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)