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

SWITCHYARD-2886 - adding usage tracking #564

Closed
wants to merge 1 commit into from

Conversation

bfitzpat
Copy link
Member

No description provided.


// when editor is opened, count the first time as a usage event
UsageEventType eventType = new UsageEventType(Activator.getDefault(),
Activator.PLUGIN_ID + ";editor-startup"); //$NON-NLS-1$

Choose a reason for hiding this comment

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

You also need to register the event type before using it.
We need to register it because we have to show all registered event types in preferences so users always can check what we track. Unregistered event type won't send anything to GA.
See https://github.com/jbosstools/jbosstools-devdoc/blob/master/api/usage/usage_api.adoc#event-registration
And an example in servers: https://github.com/jbosstools/jbosstools-server/blob/jbosstools-4.2.0.Beta1x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/JBossServerUIPlugin.java#L95-L96

And also, the best plase to create and register an event type is in your plugin start method. You don't need to do it every time you want to send a new event. You register an event type once then use it as many times as you want when sending events.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks Alexey - exactly what I was looking for.

@lhein
Copy link
Contributor

lhein commented Jul 18, 2016

testPR

@bfitzpat
Copy link
Member Author

Because this is so far out of date and SwitchYard is no longer supported, I'm going to close this PR

@bfitzpat bfitzpat closed this Nov 14, 2018
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.

None yet

3 participants