[ 
https://issues.apache.org/jira/browse/OAK-3806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15063925#comment-15063925
 ] 

Chetan Mehrotra edited comment on OAK-3806 at 12/21/15 5:33 AM:
----------------------------------------------------------------

[updated patch|^OAK-3806-v2.patch] to review the approach. This has all aspects 
(testcase, both {{AbstractBlobStore}} and {{DataStoreBlobStore}}) covered

* It introduces a {{BlobStatsCollector}} which is a callback interface to 
collect the stats. This is then invoked in {{AbstractBlobStore}} and 
{{DataStoreBlobStore}} at time of reading and writing
{code}
interface BlobStatsCollector() {
        @Override
        public void uploaded(long timeTaken, TimeUnit unit, long size) {

        }

        @Override
        public void downloaded(String blobId, long timeTaken, TimeUnit unit, 
long size) {

        }
{code}
* Stats captured
** Upload Stats
*** Number of uploads
*** Rate of Upload - Size and time taken
*** Distribution of upload size (Histrogram)
** Download Stats
*** For capturing the byte read count it wraps InputStream with 
CountingInputStream

The stats are exposed as part of {{BlobStoreStatsMBean}} with time series data 
for upload and download sizes. 

!blob-upload.png!

Screenshot of stats from histrogram

*Key Aspects*
# BlobStore logic now exposes a {{BlobStatsCollector}} callback
# {{BlobStoreStats}} implements that callback and uses Metrics to collect imp 
stats
# {{BlobStoreStatsMBean}} exposes some attributes and time series data related 
to upload and downloads
# {{StatsCollectingStreams}} - This is used to accurately collect the stats for 
download (need closer look!)

*Future Work*
Going forward I would like to build up on the stats collected. For e.g. we can 
collect some more stats on frequently downloaded blobs and then have a local 
cache for only such frequently downloaded blobs. Callback exposed provides the 
blodId for which read is being performed

[~tmueller] [~amitj_76] Can you review the approach. Key areas to looks into 
would be classes under new public package 
{{org.apache.jackrabbit.oak.spi.blob.stats}} and changes done in 
{{AbstractBlobStore}} and {{DataStoreBlobStore}}. Rest all is mostly plumbing 
code to get the wiring done!

[~ianeboston] Can you review the type of stats collected. Should they be 
refined etc


was (Author: chetanm):
[updated patch|^OAK-3806-v2.patch] to review the approach. This has all aspects 
(testcase, both {{AbstractBlobStore}} and {{DataStoreBlobStore}}) covered

* It introduces a {{BlobStatsCollector}} which is a callback interface to 
collect the stats. This is then invoked in {{AbstractBlobStore}} and 
{{DataStoreBlobStore}} at time of reading and writing
{code}
interface BlobStatsCollector() {
        @Override
        public void uploaded(long timeTaken, TimeUnit unit, long size) {

        }

        @Override
        public void downloaded(String blobId, long timeTaken, TimeUnit unit, 
long size) {

        }
{code}
* Stats captured
** Upload Stats
*** Number of uploads
*** Rate of Upload - Size and time taken
*** Distribution of upload size (Histrogram)
** Download Stats
*** For capturing the byte read count it wraps InputStream with 
CountingInputStream

The stats are exposed as part of {{BlobStoreStatsMBean}} with time series data 
for upload and download sizes. 

!blob-upload.png!

Screenshot of stats from histrogram

*Key Aspects*
# BlobStore logic now exposes a {{BlobStatsCollector}} callback
# {{BlobStoreStats}} implements that callback and uses Metrics to collect imp 
stats
# {{BlobStoreStatsMBean}} exposes some attributes and time series data related 
to upload and downloads
# {{StatsCollectingStreams}} - This is used to accurately collect the stats for 
download (need closer look!)

*Future Work*
Going forward I would like to build up on the stats collected. For e.g. we can 
collect some more stats on frequently downloaded blobs and then have a local 
cache for only such frequently downloaded blobs. Callback exposed provides the 
blodId for which read is being performed

[~tmueller] [~amitj_76] Can you review the approach.

[~ianeboston] Can you review the type of stats collected. Should they be 
refined etc

> Collect and expose statistics related to BlobStore operations
> -------------------------------------------------------------
>
>                 Key: OAK-3806
>                 URL: https://issues.apache.org/jira/browse/OAK-3806
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: blob
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: 1.3.13
>
>         Attachments: OAK-3806-v1.patch, OAK-3806-v2.patch, 
> blob-store-stats.png, blob-upload.png
>
>
> It would be useful to collect some statistics around BlobStore operations 
> like upload size, download size, how frequent uploads are done etc
> It should support following features
> * Collection across various implementation - For most cases just collecting 
> stats in {{DataStoreBlobStore}} and {{AbstractBlobStore}} should be sufficient
> * Collected stats should be exposed over JMX



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to