Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels alphabetically before bucket break Histogram #12

Open
djetelina opened this issue Nov 24, 2018 · 1 comment
Open

Labels alphabetically before bucket break Histogram #12

djetelina opened this issue Nov 24, 2018 · 1 comment

Comments

@djetelina
Copy link

One of the possible fixes:

def label_group(self, value):
    if TYPES.HISTOGRAM_BUCKET == value[0][0]:
        return [x for x in value[0][3] if x[0] != 'bucket']
    return value[0][3]

Other could be sorting bucket always first I guess, took me a while to find at least this fix.

@rembish
Copy link

rembish commented Jan 24, 2019

Nope, there is sorter method, which also works specially with HistogramBuckets. You have to update it to:

    def skip_bucket(self, value):
        return tuple(x for x in value[0][3] if x[0] != 'bucket')

    def label_group(self, value):
        if TYPES.HISTOGRAM_BUCKET == value[0][0]:
            return self.skip_bucket(value)
        return value[0][3]

    def sorter(self, value):
        if TYPES.HISTOGRAM_BUCKET == value[0][0]:
            return value[0][1], self.skip_bucket(value), value[0][0]
        return value[0][1], value[0][3], value[0][0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants