{"id":18266260,"url":"https://github.com/hdrhistogram/hdrhistogram.net","last_synced_at":"2025-05-16T14:06:04.063Z","repository":{"id":62355337,"uuid":"46350087","full_name":"HdrHistogram/HdrHistogram.NET","owner":"HdrHistogram","description":"The .NET port of HdrHistogram","archived":false,"fork":false,"pushed_at":"2024-08-22T00:41:23.000Z","size":417,"stargazers_count":179,"open_issues_count":29,"forks_count":29,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-12T17:24:08.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HdrHistogram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-17T13:51:13.000Z","updated_at":"2025-01-24T22:38:32.000Z","dependencies_parsed_at":"2022-10-31T10:51:36.537Z","dependency_job_id":"e485090d-186b-4005-8096-c8862440c255","html_url":"https://github.com/HdrHistogram/HdrHistogram.NET","commit_stats":{"total_commits":53,"total_committers":5,"mean_commits":10.6,"dds":0.09433962264150941,"last_synced_commit":"50094d3211445b896b29b154eb697bb01fbcbbe3"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HdrHistogram%2FHdrHistogram.NET","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HdrHistogram%2FHdrHistogram.NET/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HdrHistogram%2FHdrHistogram.NET/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HdrHistogram%2FHdrHistogram.NET/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HdrHistogram","download_url":"https://codeload.github.com/HdrHistogram/HdrHistogram.NET/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544146,"owners_count":22088807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:22:39.082Z","updated_at":"2025-05-16T14:05:59.050Z","avatar_url":"https://github.com/HdrHistogram.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg style=\"float: right;\" align=\"right\" height=64 src=\"https://raw.githubusercontent.com/HdrHistogram/HdrHistogram.NET/master/HdrHistogram-icon-64x64.png\" alt=\"HdrHistorgram.NET logo\"\u003e\n\n# HdrHistogram\n\nA High Dynamic Range (HDR) Histogram\n\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/HdrHistogram/HdrHistogram?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) [![Build status](https://ci.appveyor.com/api/projects/status/q0o5faahigq6u4qe/branch/master?svg=true)](https://ci.appveyor.com/project/LeeCampbell/hdrhistogram-net/branch/master) [![Build status](https://ci.appveyor.com/api/projects/status/q0o5faahigq6u4qe?svg=true)](https://ci.appveyor.com/project/LeeCampbell/hdrhistogram-net)\n\n## What is it\n\nHdrHistogram.NET is the official port of the Java HdrHistogram library.\nAll official implementations of HdrHistogram can be found at \u003chttps://github.com/HdrHistogram\u003e\n\n## Why would I use it?\n\nYou would use it to efficiently capture large number of response times measurements.\n\nOften when measuring response times, one could make the common mistake of reporting on the mean value or the 90th percentile.\nGil Tene (the original author of the Java HdrHistogram) illustrates in numerous presentations (such as [here](http://www.infoq.com/presentations/latency-pitfalls) and [here](https://www.youtube.com/watch?v=9MKY4KypBzg)) on why this is a mistake.\nInstead you want to collect all of the data and then be able to report your measurements across the range of measurements.\n\n## How would I use it?\n\nThe library is available as a package from Nuget as [HdrHistogram](https://www.nuget.org/packages/HdrHistogram/)\n\nGenerally you want to be able to record at the finest accuracy the response-time of a given function of your software.\nTo do this code might look something like this\n\n### Declare the Histogram\n\n``` csharp\n// A Histogram covering the range from ~466 nanoseconds to 1 hour (3,600,000,000,000 ns) with a resolution of 3 significant figures:\nvar histogram = new LongHistogram(TimeStamp.Hours(1), 3);\n\n```\n\n### Record your measurements\n\nNext you would record your measurements.\nThe `System.Diagnostics.Stopwatch.GetTimestamp()` method provides the most accurate way to record the elapsed time an action took to run.\nBy measuring the difference of the timestamp values before and after the action to measure, we can get the most accurate recording of elapsed\ntime available on the .NET platform.\n\n```  csharp\nlong startTimestamp = Stopwatch.GetTimestamp();\n//Execute some action to be measured\nlong elapsed = Stopwatch.GetTimestamp() - startTimestamp;\nhistogram.RecordValue(elapsed);\n\n```\n\n### Output the results\n\nOnce you have recorded all of your data, you are able to present that data based on a highly dynamic range of buckets.\nWe are not interested in all the values, but just enough of the values to get a picture of our system's performance.\nTo do this we want to generate a percentile distribution, with exponentially increasing fidelity.\n\nHere we show an example of writing to the `Console`.\n\n```  csharp\nvar writer = new StringWriter();\nvar scalingRatio = OutputScalingFactor.TimeStampToMicroseconds;\nhistogram.OutputPercentileDistribution(\n  writer,\n  outputValueUnitScalingRatio: scalingRatio);\nConsole.WriteLine(writer.ToString());\n//Or just simply write directly to the Console output  stream\n//histogram.OutputPercentileDistribution(\n//  Console.Out,\n//  outputValueUnitScalingRatio: scalingRatio);\n```\n\nWould produce output similar to:\n\n``` text\n       Value     Percentile TotalCount 1/(1-Percentile)\n\n       0.285 0.000000000000          1           1.00\n       0.448 0.100000000000       3535           1.11\n       0.466 0.200000000000       7100           1.25\n       0.497 0.300000000000      10504           1.43\n       0.523 0.400000000000      14046           1.67\n       0.535 0.500000000000      17644           2.00\n       0.541 0.550000000000      19466           2.22\n       0.547 0.600000000000      21134           2.50\n       0.555 0.650000000000      22898           2.86\n       0.567 0.700000000000      24513           3.33\n       0.594 0.750000000000      26260           4.00\n       0.609 0.775000000000      27129           4.44\n       0.627 0.800000000000      28005           5.00\n       0.642 0.825000000000      28939           5.71\n       0.660 0.850000000000      29793           6.67\n       0.680 0.875000000000      30649           8.00\n       0.687 0.887500000000      31095           8.89\n       0.693 0.900000000000      31550          10.00\n       0.698 0.912500000000      31992          11.43\n       0.703 0.925000000000      32415          13.33\n       0.710 0.937500000000      32880          16.00\n       0.713 0.943750000000      33080          17.78\n       0.717 0.950000000000      33277          20.00\n       0.721 0.956250000000      33476          22.86\n       0.727 0.962500000000      33710          26.67\n       0.736 0.968750000000      33925          32.00\n       0.741 0.971875000000      34023          35.56\n       0.748 0.975000000000      34141          40.00\n       0.757 0.978125000000      34249          45.71\n       0.768 0.981250000000      34352          53.33\n       0.786 0.984375000000      34459          64.00\n       0.803 0.985937500000      34515          71.11\n       0.815 0.987500000000      34567          80.00\n       0.838 0.989062500000      34622          91.43\n       0.869 0.990625000000      34676         106.67\n       1.045 0.992187500000      34731         128.00\n       1.815 0.992968750000      34759         142.22\n       1.943 0.993750000000      34786         160.00\n       1.989 0.994531250000      34813         182.86\n       2.038 0.995312500000      34841         213.33\n       2.087 0.996093750000      34868         256.00\n       2.127 0.996484375000      34881         284.44\n       2.161 0.996875000000      34895         320.00\n       2.225 0.997265625000      34909         365.71\n       2.355 0.997656250000      34922         426.67\n       2.539 0.998046875000      34936         512.00\n       2.601 0.998242187500      34943         568.89\n       2.653 0.998437500000      34950         640.00\n       2.689 0.998632812500      34957         731.43\n       2.755 0.998828125000      34964         853.33\n       2.801 0.999023437500      34970        1024.00\n       2.827 0.999121093750      34974        1137.78\n       2.847 0.999218750000      34977        1280.00\n       2.889 0.999316406250      34982        1462.86\n       2.947 0.999414062500      34984        1706.67\n       2.979 0.999511718750      34987        2048.00\n       3.015 0.999560546875      34989        2275.56\n       3.131 0.999609375000      34991        2560.00\n       3.267 0.999658203125      34993        2925.71\n       3.397 0.999707031250      34994        3413.33\n       3.627 0.999755859375      34996        4096.00\n       3.845 0.999780273438      34997        4551.11\n       3.995 0.999804687500      34998        5120.00\n       4.299 0.999829101563      34999        5851.43\n       4.299 0.999853515625      34999        6826.67\n       4.839 0.999877929688      35000        8192.00\n      10.039 0.999890136719      35001        9102.22\n      10.039 0.999902343750      35001       10240.00\n      11.911 0.999914550781      35002       11702.86\n      11.911 0.999926757813      35002       13653.33\n      11.911 0.999938964844      35002       16384.00\n      15.367 0.999945068359      35003       18204.44\n      15.367 0.999951171875      35003       20480.00\n      15.367 0.999957275391      35003       23405.71\n      15.367 0.999963378906      35003       27306.67\n      15.367 0.999969482422      35003       32768.00\n    2543.615 0.999972534180      35004       36408.89\n    2543.615 1.000000000000      35004\n#[Mean    =        0.633, StdDeviation   =       13.588]\n#[Max     =     2541.568, Total count    =        35004]\n#[Buckets =           21, SubBuckets     =         2048]\n```\n\nNote that in the example above a value for the optional parameter `outputValueUnitScalingRatio` is provided.\nIf you record elapsed time using the suggested method with `Stopwatch.GetTimestamp()`, then you will have recorded values in a non-standard unit of time.\nInstead of paying to cost of converting recorded values at the time of recording, record raw values.\nUse the helper methods to convert recorded values to standard units at output time, when performance is less critical.\n\n### Example of reporting results as a chart\n\nYou can also have HdrHistogram output the results in a file format that can be charted.\nThis is especially useful when comparing measurements.\n\nFirst you will need to create the file to be used as an input for the chart.\n\n```  csharp\nusing (var writer = new StreamWriter(\"HistogramResults.hgrm\"))\n{\n  histogram.OutputPercentileDistribution(writer);\n}\n```\n\nThe data can then be plotter to visualize the percentile distribution of your results.\nMultiple files can be plotted in the same chart allowing effective visual comparison of your results.\nYou can use either\n\n- the online tool - \u003chttp://hdrhistogram.github.io/HdrHistogram/plotFiles.html\u003e\n- the local tool - _.\\GoogleChartsExample\\plotFiles.html_\n  ![Example visualised plot comparing 3 percentile distributions](http://i.imgur.com/Z1wIqw1.png)\n\nIf you use the local tool, there are example result files in the _.\\GoogleChartsExample_ directory.\nThe tool also allows you to export to png.\n\n## So what is so special about this way of recording response times?\n\n- itself is low latency\n- tiny foot print due to just storing a dynamic range of buckets and counts\n- produces the reports you actually want\n\n## Full code example\n\nThis code sample show a recording of the time taken to execute a ping request.\nWe execute and record this in a loop.\n\n```  csharp\n// A Histogram covering the range from ~466 nanoseconds to 1 hour (3,600,000,000,000 ns) with a resolution of 3 significant figures:\nvar histogram = new LongHistogram(TimeStamp.Hours(1), 3);\nusing (var ping = new System.Net.NetworkInformation.Ping())\n{\n  for (int i = 0; i \u003c 100; i++)\n  {\n    long startTimestamp = Stopwatch.GetTimestamp();\n    //Execute our action we want to record.\n    ping.Send(\"www.github.com\");\n    long elapsed = Stopwatch.GetTimestamp() - startTimestamp;\n    histogram.RecordValue(elapsed);\n  }\n}\n//Output the percentile distribution of our results to the Console with values presented in Milliseconds\nhistogram.OutputPercentileDistribution(\n  printStream: Console.Out,\n  percentileTicksPerHalfDistance: 3,\n  outputValueUnitScalingRatio: OutputScalingFactor.TimeStampToMilliseconds);\n\n```\n\n**output:**\n\n``` text\n       Value     Percentile TotalCount 1/(1-Percentile)\n\n      79.360 0.000000000000          1           1.00\n      80.435 0.166666666667         17           1.20\n      80.896 0.333333333333         36           1.50\n      81.050 0.500000000000         52           2.00\n      81.152 0.583333333333         59           2.40\n      81.254 0.666666666667         70           3.00\n      81.357 0.750000000000         76           4.00\n      81.459 0.791666666667         86           4.80\n      81.459 0.833333333333         86           6.00\n      81.510 0.875000000000         93           8.00\n      81.510 0.895833333333         93           9.60\n      81.510 0.916666666667         93          12.00\n      81.562 0.937500000000         94          16.00\n      81.613 0.947916666667         98          19.20\n      81.613 0.958333333333         98          24.00\n      81.613 0.968750000000         98          32.00\n      81.613 0.973958333333         98          38.40\n      81.613 0.979166666667         98          48.00\n      81.664 0.984375000000         99          64.00\n      81.664 0.986979166667         99          76.80\n      81.664 0.989583333333         99          96.00\n      86.067 0.992187500000        100         128.00\n      86.067 1.000000000000        100\n#[Mean    =       80.964, StdDeviation   =        0.746]\n#[Max     =       86.067, Total count    =          100]\n#[Buckets =           26, SubBuckets     =         2048]\n```\n\n### How would I contribute to this project?\n\nWe welcome pull requests!\nIf you do choose to contribute, please first raise an issue so we are not caught off guard by the pull request.\nNext can you please ensure that your PR (Pull Request) has a comment in it describing what it achieves and the issues that it closes.\nIdeally if it is fixing an issue or a bug, there would be a Unit Test proving the fix and a reference to the Issues in the PR comments.\n\n---\n\n## HdrHistogram Details\n\nAn HdrHistogram supports the recording and analyzing of sampled data value counts across a configurable integer value range with configurable value precision within the range.\nValue precision is expressed as the number of significant digits in the value recording, and provides control over value quantization behavior across the value range and the subsequent value resolution at any given level.\n\nFor example, a Histogram could be configured to track the counts of observed integer values between 0 and 3,600,000,000 while maintaining a value precision of 3 significant digits across that range.\nValue quantization within the range will thus be no larger than 1/1,000th (or 0.1%) of any value.\nThis example Histogram could be used to track and analyze the counts of observed response times ranging between 1 microsecond and 1 hour in magnitude.\nThis Histogram would still maintain a value resolution of 1 microsecond up to 1 millisecond, a resolution of 1 millisecond (or better) up to one second, and a resolution of 1 second (or better) up to 1,000 seconds.\nAt its maximum tracked value (1 hour), it would still maintain a resolution of 3.6 seconds (or better).\n\nThe HdrHistogram package includes the `LongHistogram` implementation, which tracks value counts in `long` fields, and is expected to be the commonly used Histogram form.\n`IntHistogram` and `ShortHistogram`, which track value counts in `int` and `short` fields respectively, are provided for use cases where smaller count ranges are practical and smaller overall storage is beneficial.\nPerformance impacts should be measured prior to choosing one over the other in the name of optimization.\n\nHdrHistogram is designed for recoding histograms of value measurements in latency and performance sensitive applications.\nMeasurements show value recording times as low as 3-6 nanoseconds on modern (circa 2012) Intel CPUs.\nThat is, 1,000,000,000 (1 billion) recordings can be made at a total cost of around 3 seconds on modern hardware.\nA Histogram's memory footprint is constant, with no allocation operations involved in recording data values or in iterating through them.\nThe memory footprint is fixed regardless of the number of data value samples recorded, and depends solely on the dynamic range and precision chosen.\nThe amount of work involved in recording a sample is constant, and directly computes storage index locations such that no iteration or searching is ever involved in recording data values.\n\nA combination of high dynamic range and precision is useful for collection and accurate post-recording analysis of sampled value data distribution in various forms.\nWhether it's calculating or plotting arbitrary percentiles, iterating through and summarizing values in various ways, or deriving mean and standard deviation values, the fact that the recorded data information is kept in high resolution allows for accurate post-recording analysis with low [and ultimately configurable] loss in accuracy when compared to performing the same analysis directly on the potentially infinite series of sourced data values samples.\n\nAn common use example of HdrHistogram would be to record response times in units of microseconds across a dynamic range stretching from 1 usec to over an hour, with a good enough resolution to support later performing post-recording analysis on the collected data.\nAnalysis can include computing, examining, and reporting of distribution by percentiles, linear or logarithmic value buckets, mean and standard deviation, or by any other means that can can be easily added by using the various iteration techniques supported by the Histogram.\nIn order to facilitate the accuracy needed for various post-recording analysis techniques, this example can maintain a resolution of ~1 usec or better for times ranging to ~2 msec in magnitude, while at the same time maintaining a resolution of ~1 msec or better for times ranging to ~2 sec, and a resolution of ~1 second or better for values up to 2,000 seconds.\nThis sort of example resolution can be thought of as \"always accurate to 3 decimal points.\"\nSuch an example Histogram would simply be created with a highestTrackableValue of 3,600,000,000, and a numberOfSignificantValueDigits of 3, and would occupy a fixed, unchanging memory footprint of around 185KB (see \"Footprint estimation\" below).\n\n### Histogram variants and internal representation\n\nThe HdrHistogram package includes multiple implementations of the\n`HistogramBase` class:\n\n- `LongHistogram`, which is the commonly used Histogram form and tracks value counts in `long` fields.\n- `IntHistogram` and `ShortHistogram`, which track value counts in `int` and `short` fields respectively, are provided for use cases where smaller count ranges are practical and smaller overall storage is beneficial (e.g. systems where tens of thousands of in-memory histogram are being tracked).\n- `SynchronizedHistogram` (see 'Synchronization and concurrent access' below)\n\nInternally, data in HdrHistogram variants is maintained using a concept somewhat similar to that of floating point number representation.\nUsing an exponent a (non-normalized) mantissa to support a wide dynamic range at a high but varying (by exponent value) resolution.\nHistograms use exponentially increasing bucket value ranges (the parallel of the exponent portion of a floating point number) with each bucket containing a fixed number (per bucket) set of linear sub-buckets (the parallel of a non-normalized mantissa portion of a floating point number).\nBoth dynamic range and resolution are configurable, with `highestTrackableValue` controlling dynamic range, and `numberOfSignificantValueDigits` controlling resolution.\n\n### Synchronization and concurrent access\n\nIn the interest of keeping value recording cost to a minimum, the commonly used `LongHistogram` class and its `IntHistogram` and `ShortHistogram` variants are NOT internally synchronized, and do NOT use atomic variables.\nCallers wishing to make potentially concurrent, multi-threaded updates or queries against Histogram objects should either take care to externally synchronize and/or order their access, or use the `SynchronizedHistogram` variant.\nIt is worth mentioning that since Histogram objects are additive, it is common practice to use per-thread, non-synchronized histograms for the recording fast path, and \"flipping\" the actively recorded-to histogram (usually with some non-locking variants on the fast path) and having a summary/reporting thread perform histogram aggregation math across time and/or threads.\n\n### Iteration\n\nHistograms supports multiple convenient forms of iterating through the histogram data set, including linear, logarithmic, and percentile iteration mechanisms, as well as means for iterating through each recorded value or each possible value level.\nThe iteration mechanisms are accessible through the HistogramData available through `getHistogramData()`.\nIteration mechanisms all provide `HistogramIterationValue` data points along the histogram's iterated data set.\n\nRecorded values are available as instance methods:\n\n- `RecordedValues`: An `IEnumerable\u003cHistogramIterationValue\u003e` through the histogram using a `RecordedValuesEnumerable`\\`RecordedValuesEnumerator`\n- `AllValues`: An `IEnumerable\u003cHistogramIterationValue\u003e` through the histogram using a `AllValueEnumerable`\\`AllValuesEnumerator`\n\nAll others are available for the default (corrected) histogram data set via the following extension methods:\n\n- `Percentiles`: An `IEnumerable\u003cHistogramIterationValue\u003e` through the histogram using a `PercentileEnumerable`/`PercentileEnumerator`\n- `LinearBucketValues`: An `IEnumerable\u003cHistogramIterationValue\u003e` through the histogram using a `LinearBucketEnumerable`/`LinearEnumerator`\n- `LogarithmicBucketValues`: An `IEnumerable\u003cHistogramIterationValue\u003e` through the histogram using a `LogarithmicBucketEnumerable`/`LogarithmicEnumerator`\n\nIteration is typically done with a for-each loop statement. E.g.:\n\n``` csharp\nforeach (var v in histogram.Percentiles(ticksPerHalfDistance))\n{\n  ...\n}\n```\n\n or\n\n``` csharp\nfor (var v in histogram.LinearBucketValues(unitsPerBucket))\n{\n  ...\n}\n```\n\nThese enumerators are optimised for fast forward readonly \"_hosepipe_\" usage.\nThey are low allocation and may reuse objects internally to keep allocations low and thus reduce garbage collection/memory pressure.\n\n### Equivalent Values and value ranges\n\nDue to the finite (and configurable) resolution of the histogram, multiple adjacent integer data values can be \"equivalent\".\nTwo values are considered \"equivalent\" if samples recorded for both are always counted in a common total count due to the histogram's resolution level.\nHdrHistogram provides methods for\n\n- determining the lowest and highest equivalent values for any given value,\n- determining whether two values are equivalent,\n- finding the next non-equivalent value for a given value (useful when looping through values, in order to avoid a double-counting count).\n\n### Corrected vs. Raw value recording calls\n\nIn order to support a common use case needed when histogram values are used to track response time distribution, Histogram provides for the recording of corrected histogram value by supporting a `RecordValueWithExpectedInterval(long, long)` variant is provided.\nThis value recording form is useful in [common latency measurement] scenarios where response times may exceed the expected interval between issuing requests, leading to \"dropped\" response time measurements that would typically correlate with \"bad\" results.\n\nWhen a value recorded in the histogram exceeds the `expectedIntervalBetweenValueSamples` parameter, recorded histogram data will reflect an appropriate number of additional values, linearly decreasing in steps of `expectedIntervalBetweenValueSamples`, down to the last value that would still be higher than `expectedIntervalBetweenValueSamples`.\n\nTo illustrate why this corrective behavior is critically needed in order to accurately represent value distribution when large value measurements may lead to missed samples, imagine a system for which response times samples are taken once every 10 msec to characterize response time distribution.\nThe hypothetical system behaves \"perfectly\" for 100 seconds (10,000 recorded samples), with each sample showing a 1 msec response time value.\nAt each sample for 100 seconds (10,000 logged samples at 1 msec each).\nThe hypothetical system then encounters a 100 sec pause during which only a single sample is recorded (with a 100 second value).\nThe raw data histogram collected for such a hypothetical system (over the 200 second scenario above) would show ~99.99% of results at 1 msec or below, which is obviously \"not right\".\nThe same histogram, corrected with the knowledge of an `expectedIntervalBetweenValueSamples` of 10msec will correctly represent the response time distribution.\nOnly ~50% of results will be at 1 msec or below, with the remaining 50% coming from the auto-generated value records covering the missing increments spread between 10msec and 100 sec.\n\nData sets recorded with and without an `expectedIntervalBetweenValueSamples` parameter will differ only if at least one value recorded with the `RecordValue(..)` method was greater than its associated `expectedIntervalBetweenValueSamples` parameter.\nData sets recorded with an `expectedIntervalBetweenValueSamples` parameter will be identical to ones recorded without it if all values recorded via the `RecordValue(..)` calls were smaller than their associated (and optional) `expectedIntervalBetweenValueSamples` parameters.\n\nWhen used for response time characterization, the recording with the optional `expectedIntervalBetweenValueSamples` parameter will tend to produce data sets that would much more accurately reflect the response time distribution that a random, uncoordinated request would have experienced.\n\n### Footprint estimation\n\nDue to it's dynamic range representation, Histogram is relatively efficient in memory space requirements given the accuracy and dynamic range it covers.\nStill, it is useful to be able to estimate the memory footprint involved for a given `highestTrackableValue` and `numberOfSignificantValueDigits` combination.\nBeyond a relatively small fixed-size footprint used for internal fields and stats (which can be estimated as \"fixed at well less than 1KB\"), the bulk of a Histogram's storage is taken up by it's data value recording counts array.\nThe total footprint can be conservatively estimated by:\n\n```  csharp\n largestValueWithSingleUnitResolution = 2 * (10 ^ numberOfSignificantValueDigits);\n subBucketSize = RoundedUpToNearestPowerOf2(largestValueWithSingleUnitResolution);\n\n expectedHistogramFootprintInBytes = 512 +\n      ({primitive type size} / 2) *\n      (Log2RoundedUp((highestTrackableValue) / subBucketSize) + 2) *\n      subBucketSize;\n```\n\nA conservative (high) estimate of a Histogram's footprint in bytes is available via the `GetEstimatedFootprintInBytes()` method.\n\n## Terminology\n\n- **Latency** : The time that something is latent i.e. not being processed.\n This maybe due to being in a queue.\n- **Service Time** : The time taken to actually service a request.\n- **Response time** : The sum of the latency and the service time. e.g. the time your request was queued, plus the time it took to process.\n\nReferences (see also):\n\n- [How NOT to Measure Latency](http://www.infoq.com/presentations/latency-pitfalls) Gil Tene - qCon 2013\n- [Understanding Latency](https://www.youtube.com/watch?v=9MKY4KypBzg)  Gil Tene - React San Francisco 2014\n- [Designing for Performance](https://youtu.be/fDGWWpHlzvw?t=4m56s) Martin Thompson - GOTO Chicago 2015\n- https://en.wikipedia.org/wiki/Response_time_(technology)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdrhistogram%2Fhdrhistogram.net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhdrhistogram%2Fhdrhistogram.net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdrhistogram%2Fhdrhistogram.net/lists"}