-
Notifications
You must be signed in to change notification settings - Fork 132
Metrics : add metrics listener and call its methods in appropriate places #316
Conversation
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.
A few remarks
*/ | ||
|
||
public void setMetricsListener(MetricsListener metricsListener) { | ||
this.mMetricsListener = metricsListener; |
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.
remove this.
*/ | ||
|
||
public void setMetricsListener(MetricsListener metricsListener) { | ||
this.mMetricsListener = metricsListener; |
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.
same remark
* | ||
* @param metricsListener the metrics listener | ||
*/ | ||
|
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.
remove extra new line
@@ -430,6 +434,16 @@ public MXDataHandler getDataHandler() { | |||
return mDataHandler; | |||
} | |||
|
|||
/** | |||
* Update the metrics listener mode |
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.
mode
?
* | ||
* @param metricsListener the metrics listener | ||
*/ | ||
|
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.
remove extra new line
@@ -279,6 +282,11 @@ private void setIsKilled(boolean isKilled) { | |||
} | |||
} | |||
|
|||
public MXFileStore setMetricsListener(MetricsListener metricsListener) { |
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.
Add Javadoc
@@ -279,6 +282,11 @@ private void setIsKilled(boolean isKilled) { | |||
} | |||
} | |||
|
|||
public MXFileStore setMetricsListener(MetricsListener metricsListener) { | |||
this.mMetricsListener = metricsListener; |
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.
remove this.
@@ -129,6 +132,17 @@ public EventsThread(Context context, EventsRestClient apiClient, EventsThreadLis | |||
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); | |||
} | |||
|
|||
|
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.
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; |
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.
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(); |
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.
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); |
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.
So this will be be called on another thread, maybe we should specify it on the Javadoc
The metrics are then pushed to analytics tools.
It refers to element-hq/riot-android#2391