jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrei Dulceanu (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (OAK-4097) Add metric for FileStore journal writes
Date Mon, 08 Aug 2016 14:47:20 GMT

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

Andrei Dulceanu edited comment on OAK-4097 at 8/8/16 2:46 PM:
--------------------------------------------------------------

Actually I found a bug in my previous implementation which showed up because each time {{FileStore.flush()}}
was invoked {{FileStoreStats.flushed()}} was called, although the intention was to capture
only the calls which result in writes to the journal file (which happen only if the root record
has changed since last time). I corrected this and also replaced {{FileStoreStatsMBean.getJournalWriteStats()}}
with {{getJournalWriteStatsAsCount()}} and {{getJournalWriteStatsAsCompositeData()}} to improve
testability. I also added a basic check in {{FileStoreStatsTest.tarWriterIntegration()}} to
verify that the journal contains one entry if one record is written to the store. I enclose
the patch containing these changes.

IMO testing this metric can be better captured by an IT with this scenario:
# Create file store.
# Create some node under root with a property of type long ("count",0)
# Save the session
# Each 6 seconds increase the count property and save the session
# Repeat previous step 10 times.
# Since the {{flushOperation}} is called each 5 seconds, check that the {{FileStoreStats.getJournalWriteStatsAsCount()}}
returns 10.

[~mduerig], [~chetanm] WDYT? If you find the IT approach valuable, I'll go ahead and provide
a new patch containing all the above changes.



was (Author: dulceanu):
Actually I found a bug in my previous implementation which showed up because each time {{FileStore.flush()}}
was invoked {{FileStoreStats.flushed()}} was called, although the intention was to capture
only the calls which result in writes to the journal file (which happen only if the root record
has changed since last time). I corrected this and also replaced {{FileStoreStatsMBean.getJournalWriteStats()}}
with {{getJournalWriteStatsAsCount()}} and {{getJournalWriteStatsAsCompositeData()}} to improve
testability. I also added a basic check in {{FileStoreStats.tarWriterIntegration()}} to verify
that the journal contains one entry if one record is written to the store. I enclose the patch
containing these changes.

IMO testing this metric can be better captured by an IT with this scenario:
# Create file store.
# Create some node under root with a property of type long ("count",0)
# Save the session
# Each 6 seconds increase the count property and save the session
# Repeat previous step 10 times.
# Since the {{flushOperation}} is called each 5 seconds, check that the {{FileStoreStats.getJournalWriteStatsAsCount()}}
returns 10.

[~mduerig], [~chetanm] WDYT? If you find the IT approach valuable, I'll go ahead and provide
a new patch containing all the above changes.


> Add metric for FileStore journal writes
> ---------------------------------------
>
>                 Key: OAK-4097
>                 URL: https://issues.apache.org/jira/browse/OAK-4097
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: segment-tar
>            Reporter: Chetan Mehrotra
>            Assignee: Andrei Dulceanu
>            Priority: Minor
>             Fix For: Segment Tar 0.0.10
>
>         Attachments: OAK-4097-01.patch, OAK-4097-02.patch
>
>
> TarMK flush thread should run every 5 secs and flush the current root head to journal.log.
It would be good to have a metric to capture the number of runs per minute
> This would help in confirming if flush is working at expected frequency or delay in acquiring
locks is causing some delays



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

Mime
View raw message