Fix ObjectEqualityComparer used in aggregatorstore (#2177)

This commit is contained in:
Cijo Thomas 2021-07-22 13:23:16 -07:00 committed by GitHub
parent 4b2e200ffb
commit 2476bdb219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -41,7 +41,7 @@ namespace OpenTelemetry.Metrics
for (int i = 0; i < len1; i++)
{
if (obj1[i] != obj2[i])
if (!obj1[i].Equals(obj2[i]))
{
return false;
}

View File

@ -110,6 +110,11 @@ namespace Benchmarks.Metrics
}
[Benchmark]
public void CounterWith1LabelLocal()
{
this.counter?.Add(100, new KeyValuePair<string, object>("key", "value"));
}
public void CounterWith3LabelsHotPath()
{
this.counter?.Add(100, this.tag1, this.tag2, this.tag3);