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

Diagnostics: Adds performance improvement to GetContactedRegions() #2907

Merged
merged 54 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
cc472dd
declare region globally
sourabh1007 Nov 9, 2021
03abd7e
Performance test
sourabh1007 Nov 23, 2021
337a7e5
Revert "Performance test"
sourabh1007 Dec 15, 2021
bb9614e
Revert "declare region globally"
sourabh1007 Dec 15, 2021
cd6a276
made region contacted as first class variable
sourabh1007 Dec 16, 2021
59f9f9a
added benchmark
sourabh1007 Dec 16, 2021
e746d03
null checks
sourabh1007 Dec 16, 2021
a07a4be
Revert "null checks"
sourabh1007 Dec 16, 2021
3be34c1
Revert "made region contacted as first class variable"
sourabh1007 Dec 16, 2021
36edab8
remove unnecessary tests
sourabh1007 Dec 16, 2021
f5f72b8
add scenario
sourabh1007 Dec 16, 2021
dbb207a
update parent on child update
sourabh1007 Dec 20, 2021
8b61d93
fix errors
sourabh1007 Dec 20, 2021
6931680
baseline tests
sourabh1007 Dec 20, 2021
6414786
set list size to 0
sourabh1007 Dec 20, 2021
2743574
return null if regioncontacted info is not there
sourabh1007 Dec 20, 2021
f314545
code refatoring
sourabh1007 Dec 21, 2021
38099d7
add null check
sourabh1007 Dec 21, 2021
397e44e
update baseline test
sourabh1007 Dec 21, 2021
84ac690
update baseline
sourabh1007 Dec 21, 2021
fe49bd6
Revert "update baseline"
sourabh1007 Dec 21, 2021
f072f0a
baseline tests
sourabh1007 Dec 21, 2021
5b7e5d5
update region with tracedatnum
sourabh1007 Dec 22, 2021
3037780
fix baseline
sourabh1007 Dec 22, 2021
711412e
fix commit compare issue
sourabh1007 Dec 29, 2021
f288820
Itrace as abstract class with default implementation for Region conta…
sourabh1007 Dec 29, 2021
8f770c3
abstract memebers
sourabh1007 Dec 29, 2021
ff6aeb3
renamed Telemetry Benchmark to region contacted Benchmark
sourabh1007 Dec 29, 2021
e81da06
add doc
sourabh1007 Dec 29, 2021
1b4d5bb
add abstract trace for default implementation
sourabh1007 Jan 3, 2022
d4110c8
iset to hashset
sourabh1007 Jan 3, 2022
139d5a1
optimization
sourabh1007 Jan 3, 2022
aa83cdd
Revert "optimization"
sourabh1007 Jan 3, 2022
d3eeb43
rename AbstractTrace to TraceBase and Hashset to Iset
sourabh1007 Jan 7, 2022
1e3e093
remove extra file
sourabh1007 Jan 7, 2022
06b23be
Iset to I readonly list
sourabh1007 Jan 7, 2022
82409ea
code fix
sourabh1007 Jan 7, 2022
94900e0
collect region info on exception scenario
sourabh1007 Jan 10, 2022
9f262ab
move code to finally block
sourabh1007 Jan 10, 2022
39d9e9c
code refactor
sourabh1007 Jan 10, 2022
c63d735
remove abstrcat ckass
sourabh1007 Jan 10, 2022
d42c967
remove unneccesary change
sourabh1007 Jan 10, 2022
5e2d807
Revert baseline and use interface for tracedatum
sourabh1007 Jan 11, 2022
bebe435
Revert "Revert baseline and use interface for tracedatum"
sourabh1007 Jan 11, 2022
4ede83e
remove baseline files
sourabh1007 Jan 11, 2022
865b13f
put lock
sourabh1007 Jan 11, 2022
bbd53f9
code refactor
sourabh1007 Jan 11, 2022
87cd18c
top to bottom approch
sourabh1007 Jan 11, 2022
eb8389b
remove unneccessary toList
sourabh1007 Jan 12, 2022
f6944d3
fix tests
sourabh1007 Jan 12, 2022
07d2ef1
fix crlf
sourabh1007 Jan 12, 2022
bde489d
Revert "fix crlf"
sourabh1007 Jan 12, 2022
ec32674
crlf fix
sourabh1007 Jan 12, 2022
b94d9cb
Merge branch 'master' into users/sourabhjain/regioncontactedOptimization
sourabh1007 Jan 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Revert baseline and use interface for tracedatum"
This reverts commit 3680d0f.
  • Loading branch information
sourabh1007 committed Jan 11, 2022
commit bebe4357179ecff4b295a62905d326df51dbdff0
3 changes: 1 addition & 2 deletions Microsoft.Azure.Cosmos/src/Tracing/ITrace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace Microsoft.Azure.Cosmos.Tracing
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Microsoft.Azure.Documents;

/// <summary>
/// Interface to represent a single node in a trace tree.
Expand Down Expand Up @@ -130,6 +129,6 @@ ITrace StartChild(
/// Update region contacted information to the parent Itrace
/// </summary>
/// <param name="traceDatum"></param>
void UpdateRegionContacted(IClientSideRequestStatistics traceDatum);
void UpdateRegionContacted(TraceDatum traceDatum);
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
j82w marked this conversation as resolved.
Show resolved Hide resolved
}
}
3 changes: 1 addition & 2 deletions Microsoft.Azure.Cosmos/src/Tracing/NoOpTrace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace Microsoft.Azure.Cosmos.Tracing
{
using System;
using System.Collections.Generic;
using Microsoft.Azure.Documents;

internal sealed class NoOpTrace : ITrace
{
Expand Down Expand Up @@ -93,7 +92,7 @@ public void AddChild(ITrace trace)
// NoOp
}

public void UpdateRegionContacted(IClientSideRequestStatistics traceDatum)
public void UpdateRegionContacted(TraceDatum traceDatum)
{
// NoOp
}
Expand Down
19 changes: 9 additions & 10 deletions Microsoft.Azure.Cosmos/src/Tracing/Trace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Cosmos.Tracing
using System.Linq;
using System.Runtime.CompilerServices;
using Microsoft.Azure.Cosmos.Tracing.TraceData;
using Microsoft.Azure.Documents;

internal sealed class Trace : ITrace
{
Expand Down Expand Up @@ -89,14 +88,17 @@ private Trace(
/// <summary>
/// Update region contacted information to the parent Itrace
/// </summary>
/// <param name="clientSideRequestStatisticsTraceDatum"></param>
public void UpdateRegionContacted(IClientSideRequestStatistics clientSideRequestStatisticsTraceDatum)
/// <param name="traceDatum"></param>
public void UpdateRegionContacted(TraceDatum traceDatum)
{
if (clientSideRequestStatisticsTraceDatum.RegionsContacted == null || clientSideRequestStatisticsTraceDatum.RegionsContacted.Count == 0)
if (traceDatum is ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum)
{
return;
if (clientSideRequestStatisticsTraceDatum.RegionsContacted == null || clientSideRequestStatisticsTraceDatum.RegionsContacted.Count == 0)
{
return;
}
this.RegionsContacted = clientSideRequestStatisticsTraceDatum.RegionsContacted?.ToList();
}
this.RegionsContacted = clientSideRequestStatisticsTraceDatum.RegionsContacted?.ToList();
}

public void Dispose()
Expand Down Expand Up @@ -174,10 +176,7 @@ public static Trace GetRootTrace(
public void AddDatum(string key, TraceDatum traceDatum)
{
this.data.Add(key, traceDatum);
if (traceDatum is ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum)
{
this.UpdateRegionContacted(clientSideRequestStatisticsTraceDatum);
}
this.UpdateRegionContacted(traceDatum);
}

public void AddDatum(string key, object value)
Expand Down
Loading