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

Wrong percentile result #7

Closed
ankurparihar opened this issue Apr 15, 2021 · 4 comments
Closed

Wrong percentile result #7

ankurparihar opened this issue Apr 15, 2021 · 4 comments

Comments

@ankurparihar
Copy link

ankurparihar commented Apr 15, 2021

use Statistics::Descriptive;
my $latencystat = Statistics::Descriptive::Full->new();

$latencystat->clear();
$latencystat->add_data(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
print ($latencystat->count(), " ", $latencystat->mean(), " ", $latencystat->percentile(99), "\n");

Results in
10 1 19

Expected
10 1 1

Perl version is 5

@shlomif
Copy link
Owner

shlomif commented Nov 25, 2021

This is due to list context. this works:

#! /usr/bin/env perl

use strict;
use warnings;
use 5.014;
use autodie;

use Statistics::Descriptive;
my $latencystat = Statistics::Descriptive::Full->new();

$latencystat->clear();
$latencystat->add_data(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
print ($latencystat->count(), " ", $latencystat->mean(), " ", scalar($latencystat->percentile(99)), "\n");

can this ticket be closed?

@shlomif
Copy link
Owner

shlomif commented Nov 25, 2021

@ankurparihar :

@ankurparihar
Copy link
Author

Thanks for reaching out. Haven't tried this yet.

It can be closed.

@shlomif
Copy link
Owner

shlomif commented Nov 29, 2021

Thanks for reaching out. Haven't tried this yet.

It can be closed.

closing then.

@shlomif shlomif closed this as completed Nov 29, 2021
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