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

switch to google analytics #408

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

switch to google analytics #408

wants to merge 3 commits into from

Conversation

lovettchris
Copy link
Member

@lovettchris lovettchris commented Oct 26, 2022

here's the test event coming through on Google Analytics realtime dashboard, there is still some more work to do to figure out how to get the right charts and graphs that we want for these custom events. I'm pretty sure the data is coming through, but it takes a day or so for it to show up and be available for ad-hoc queries and the non-realtime charts.

image

@@ -267,7 +267,8 @@ public void Run()

if (this.Configuration.IsTelemetryEnabled)
{
this.TrackTelemetry();
// 10 seconds should be enough, any more than that and too bad.
this.TrackTelemetry().Wait(10000, this.CancellationTokenSource.Token);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the typical wait time btw?

Also, I wonder if we should check (not here, probably inside the client) if there is even network connection and if not to just disable telemetry and return a Completed.Task? (This could optimize cases where say someone is for some reason having left telemetry on, and run tests in some no-network box.) Perhaps this is already implemented, I have not looked into the actual underlying logic yet :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick unscientific local test is getting round trip times in the 50-70 millisecond range. Google is very fast with all their services. When I was playing with firebase I was getting round trip times in the under 10 ms range sometimes down to 2 ms which is simply nuts, I was calculating it was basically the speed of light... let's say I was lucky and were hitting their Dalles Oregon datacenter, that's 267 miles, round trip 534, which in 3ms is /0.003 is 178,000 miles per second. Speed of light is 186,000 mi/s!

Note the Google Analytics GA4 SLA talks about somewhere upward of 96%, so it is possible a call also fail when GA4 is down also and it's hard to know how much retry logic happens automatically in an HTTP stack which is why I put a 10 second cap on it.

Good idea checking for network availability. Checking network availability is a bit tricky sometimes, because you can have a network interface that is talking to a local router, but no internet connection, and the only way to really check for an internet connection is to try ping something outside, well if we're doing that then we might as well make this the ping!

There is System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable() but guess what, it returns true when I put my machine into airplane mode :-)

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

Successfully merging this pull request may close these issues.

2 participants