Skip to content

Conversation

premun
Copy link
Member

@premun premun commented Nov 16, 2021

@premun
Copy link
Member Author

premun commented Nov 16, 2021

@MattGal would you care to have a look at this one? I made this after your suggestion and it was a really good idea since it will give us a lot of useful signals (see the linked issue for details)

@@ -157,8 +157,10 @@ def analyze_operation(command: str, platform: str, device: str, isDevice: bool,

print(f"Reporting {len(operations)} events from diagnostics file `{diagnostics_file}`")

# Parse operations, analyze them and send them to Application Insights
retry_dimensions = None
Copy link
Member

Choose a reason for hiding this comment

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

what value do these provide? Why not just use custom_dimensions in all metric sending?

Copy link
Member Author

Choose a reason for hiding this comment

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

So imagine you run a sequence of XHarness operations:

  • xharness android device
  • xharness android install
  • xharness android run <- let's say this one fails because the device is locked
  • xharness uninstall

These are processed in the for loop, the 3rd one is identified as a reason to retry/reboot.

Below, outside of the for loop, we want to report the retry with as much info as possible.
Some of the operations might have less info (which device was used, which target..) so we want to pin the one operation that gets us the retry and take its dimensions and use it with the retry/reboot.

I will maybe just use its exit code as the metric value though.

Copy link
Member

Choose a reason for hiding this comment

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

I am maybe not following, so you view this as something for the future where you'll have other reboot / retry dimensions? If so, I'd suggest you just add that when such a thing is possible. I don't see any possible way for the values to vary based off which stage of device/install/run/uninstall we're at.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I follow?

I need to emit only one retry/reboot event per work item. I want the event to have some custom dimensions so that I can have a query such as "give me the number of reboots on iOS 14.2 devices". This is just an example and I'm not sure exactly what queries will be useful in the end but why not have the data with the event?

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you proposing I emit it the retry event when setting the retry variable to true?

Copy link
Member

Choose a reason for hiding this comment

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

I'm just saying from my reading of the code you're always just sending custom_dimensions with no modifications, so lines 211 and 215 could just use custom_dimensions. I assume there's some future extensibility reason for it and I don't see anything that wouldn't work here so I'll just approve and assume you have some purpose in mind or I'm not seeing something :).

@MattGal
Copy link
Member

MattGal commented Nov 16, 2021

@MattGal would you care to have a look at this one? I made this after your suggestion and it was a really good idea since it will give us a lot of useful signals (see the linked issue for details)

No objections here, but I don't see why you declare new variables.

@@ -157,8 +157,10 @@ def analyze_operation(command: str, platform: str, device: str, isDevice: bool,

print(f"Reporting {len(operations)} events from diagnostics file `{diagnostics_file}`")

# Parse operations, analyze them and send them to Application Insights
retry_dimensions = None
Copy link
Member

Choose a reason for hiding this comment

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

I'm just saying from my reading of the code you're always just sending custom_dimensions with no modifications, so lines 211 and 215 could just use custom_dimensions. I assume there's some future extensibility reason for it and I don't see anything that wouldn't work here so I'll just approve and assume you have some purpose in mind or I'm not seeing something :).

@premun premun merged commit ade4f45 into dotnet:main Nov 18, 2021
@premun
Copy link
Member Author

premun commented Nov 18, 2021

Custom dimensions doesn't live outside of that for loop though.

And I don't want to get the last one that was set in the loop because at least for Apple it won't have enough data (it will be uninstall most likely)

@premun premun deleted the prvysoky/retry-reboot-metrics branch November 25, 2021 09:54
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