[
https://issues.apache.org/jira/browse/OAK-3791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15061869#comment-15061869
]
Chetan Mehrotra commented on OAK-3791:
--------------------------------------
Couple of points
# You can have a required reference for StatisticsProvider as for OSGi
{{StatisticsProviderFactory}} would always provide an instance either NOOP or
Metrics based one. For setup to run in default case (non OSGi) you can set this
to {{StatisticsProvider.NOOP}}. This would allow you to have a final reference
in DocumentStoreStats and make it immutable. This should simplify bit of
plumbing code!
*Calling Pattern*
Instead of
{code}
@Override
public <T extends Document> void remove(Collection<T> collection, String
id) {
+ TimerStats timer =
this.stats.getTimer(DocumentStoreStats.Metric.REMOVE);
+ TimerStats.Context ctx = timer.time();
+ try {
delete(collection, id);
invalidateCache(collection, id, true);
}
+ finally {
+ ctx.stop();
+ }
+ }
{code}
It would be preferable to have
{code}
public <T extends Document>void remove(Collection<T>collection,String id){
Context ctx = this.stats.startTimeer(collection,
DocumentStoreStats.Metric.REMOVE);
try{
delete(collection,id);
invalidateCache(collection,id,true);
finally{
ctx.stop();
}
}
{code}
It would allow
# Less noise in code related to monitoring -
# Would allow us to enable stats only for NODES collection. This logic lives in
DocumentStoreStats
# For find and query method also pass the id. Later we can use the id for other
stats calculation like most accessed path
# Use {{EnumMap}} in DocumentStoreStats. That would allow faster access to
metric instance
> Time measurements for DocumentStore methods
> -------------------------------------------
>
> Key: OAK-3791
> URL: https://issues.apache.org/jira/browse/OAK-3791
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core, documentmk
> Reporter: Teodor Rosu
> Priority: Minor
> Attachments: OAK-3791-RDB-0.patch
>
>
> For monitoring ( in big latency environments ), it would be useful to measure
> and report time for the DocumentStore methods.
> These could be exposed as (and/or):
> - as Timers generated obtained from StatisticsProvider ( statistics registry )
> - as TimeSeries
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)