-
Notifications
You must be signed in to change notification settings - Fork 24
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
Don't enforce save state when saving is triggered by a timeout and reduce tracing layout analytics event count #5999
Conversation
@philippotto Do you want to / could you please take a look at this? |
@@ -313,7 +315,6 @@ class FlexLayoutWrapper extends React.PureComponent<Props, State> { | |||
} | |||
|
|||
onLayoutChange = () => { | |||
sendAnalyticsEvent("change_tracing_layout", { viewMode: this.props.layoutKey }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the analytics here and moved it into onAction
as each change to the layout, first triggers an action. This method gets information about what action was done and therefore can better decide whether to send an analytics event.
However, the onAction
method is not called when the layout is completely rebuild. For that case the event is also send in rebuildLayout
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Works very well 👍 Regarding the events, I noticed two further things which should probably be ignored.
@@ -68,6 +68,8 @@ type State = { | |||
model: Model, | |||
}; | |||
|
|||
const ignoredLayoutChangesByAnalytics = ["FlexLayout_SetActiveTabset"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, the following scenarios shouldn't send an event, either:
- toggling the side bars
- switching tabs (in the sidebar, the event is already ignored. but when moving XY and XZ next to each other, switching the tabs sends events)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But moving the viewport around and resizing them should still send the event? Or should the event only be send when switching between layouts?
Edit: And what about maximizing a viewport?
I think it depends on what exactly we want to track / use this tracking event for.
@normanrz Do you have an opinion what we want to track with the change_tracing_layout
event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it depends on what exactly we want to track / use this tracking event for.
Yes, definitely. I don't have a strong opinion about what we really want to track, but I'm leaning towards tracking only stuff which is not "obvious" (e.g., it seems obvious that users will click on tabs to switch between them). With regard to maximizing, resizing and switching layouts, I'm not too sure that this is obvious for all users. Therefore, these events seem more interesting to me. However, in the end, this is also not very high-pri / not worth delving into how to filter the events best. So, maybe opt for the easier route if it makes sense (e.g., only track switches between layouts).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
I just added a commit that adds an additional analytics event that tracks when the user changed between any two layouts. This allows tracking whether multiple layouts are actively used / switched between or whether a user usually stays at only one active layout changing this one over and over again. |
componentDidUpdate(prevProps: Props) { | ||
const { layoutName, layoutKey } = this.props; | ||
if (layoutName !== prevProps.layoutName || layoutKey !== prevProps.layoutKey) { | ||
sendAnalyticsEvent("switched_layout", { | ||
from: { viewMode: prevProps.layoutKey, layoutName: prevProps.layoutName }, | ||
to: { | ||
viewMode: this.props.layoutKey, | ||
layoutName: this.props.layoutName, | ||
}, | ||
}); | ||
this.rebuildLayout(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the change 👀
59b2e10
to
22b48cd
Compare
Great! Makes total sense 👍 |
@MichaelBuessemeyer What's the status here? I think, the PR can be merged? |
Whoopsie, I forgot this pr. |
…ssos into docs * 'docs' of github.com:scalableminds/webknossos: * 'master' of github.com:scalableminds/webknossos: Split cells via Min Cut (#5885) Clean up backend util package (#6048) Guard against empty saves (#6052) Time tracking: Do not fail on empty timespans list (#6051) Fix clip button changing position (#6050) Include ParamFailure values in error chains (#6045) Fix non-32-aligned bucket requests (#6047) Don't enforce save state when saving is triggered by a timeout and reduce tracing layout analytics event count (#5999) Bump cached-path-relative from 1.0.2 to 1.1.0 (#5994) Volume annotation download: zip with BEST_SPEED (#6036) Sensible scalebar values (#6034) Faster CircleCI builds (#6040) move to Google Analytics 4 (#6031) Fix nightly (fix tokens, upgrade puppeteer) (#6032) Add neuron reconstruction job backend and frontend part (#5922) Allow uploading multi-layer volume annotations (#6028)
* docs: Split cells via Min Cut (#5885) Clean up backend util package (#6048) Guard against empty saves (#6052) Time tracking: Do not fail on empty timespans list (#6051) Fix clip button changing position (#6050) Include ParamFailure values in error chains (#6045) Fix non-32-aligned bucket requests (#6047) Don't enforce save state when saving is triggered by a timeout and reduce tracing layout analytics event count (#5999) Bump cached-path-relative from 1.0.2 to 1.1.0 (#5994) Volume annotation download: zip with BEST_SPEED (#6036) Sensible scalebar values (#6034) Faster CircleCI builds (#6040) move to Google Analytics 4 (#6031) Fix nightly (fix tokens, upgrade puppeteer) (#6032) Add neuron reconstruction job backend and frontend part (#5922) Allow uploading multi-layer volume annotations (#6028)
This PR tackles two small bugs. The first is, that the save queue tried to read a clean save state even when a timeout triggered the updates. This caused a lot of update actions send over the network. Now save updates triggered by a timeout only take the current changes and send these to the backend. It is no longer tried to reach a save state where the backend knows all changes the frontend has made so they are in sync.
The second part fixes that the
load_custom_layout
analytics event was triggered even when the active viewport was changed (e.g. via clicking). The is omits these updates. @normanrz @philippotto Could you think of anything else that should be ignored? Additionally, I could attach the action that triggered the analytics event (a very small object) to the event. This might give more insight if wanted. Such an action looks like this:URL of deployed dev instance (used for testing):
Steps to test:
load_custom_layout
as a key.load_custom_layout
.Issues:
change_tracing_layout
is also sent when switching viewports #5574(Please delete unneeded items, merge only when none are left open)