Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Metrics : add metrics listener and call its methods in appropriate places #316

Merged
merged 7 commits into from
Jul 16, 2018

Conversation

ganfra
Copy link
Contributor

@ganfra ganfra commented Jul 11, 2018

The metrics are then pushed to analytics tools.
It refers to element-hq/riot-android#2391

@ganfra ganfra requested a review from bmarty July 11, 2018 16:44
Copy link
Contributor

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

A few remarks

*/

public void setMetricsListener(MetricsListener metricsListener) {
this.mMetricsListener = metricsListener;
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this.

*/

public void setMetricsListener(MetricsListener metricsListener) {
this.mMetricsListener = metricsListener;
Copy link
Contributor

Choose a reason for hiding this comment

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

same remark

*
* @param metricsListener the metrics listener
*/

Copy link
Contributor

Choose a reason for hiding this comment

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

remove extra new line

@@ -430,6 +434,16 @@ public MXDataHandler getDataHandler() {
return mDataHandler;
}

/**
* Update the metrics listener mode
Copy link
Contributor

Choose a reason for hiding this comment

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

mode ?

*
* @param metricsListener the metrics listener
*/

Copy link
Contributor

Choose a reason for hiding this comment

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

remove extra new line

@@ -279,6 +282,11 @@ private void setIsKilled(boolean isKilled) {
}
}

public MXFileStore setMetricsListener(MetricsListener metricsListener) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add Javadoc

@@ -279,6 +282,11 @@ private void setIsKilled(boolean isKilled) {
}
}

public MXFileStore setMetricsListener(MetricsListener metricsListener) {
this.mMetricsListener = metricsListener;
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this.

@@ -129,6 +132,17 @@ public EventsThread(Context context, EventsRestClient apiClient, EventsThreadLis
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
}


Copy link
Contributor

Choose a reason for hiding this comment

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

same remark than for other classes

@@ -279,6 +282,11 @@ private void setIsKilled(boolean isKilled) {
}
}

public MXFileStore setMetricsListener(MetricsListener metricsListener) {
this.mMetricsListener = metricsListener;
return this;
Copy link
Contributor

Choose a reason for hiding this comment

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

Only this one return this. Consider also for the other similar method, or don't do that

if (isInitialSyncDone()) {
// get the latest events asap
resumeInitialSync();
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for creating subs :)

@@ -529,6 +522,9 @@ public void run() {
// extract the room states
mRoomReceiptsToLoad.addAll(listFiles(mStoreRoomsMessagesReceiptsFolderFile.list()));
mPreloadTime = System.currentTimeMillis() - fLoadTimeT0;
if (mMetricsListener != null) {
mMetricsListener.onStorePreloaded(mPreloadTime);
Copy link
Contributor

Choose a reason for hiding this comment

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

So this will be be called on another thread, maybe we should specify it on the Javadoc

@ganfra ganfra merged commit da2e127 into develop Jul 16, 2018
@ganfra ganfra deleted the feature/metrics branch July 16, 2018 13:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants