-
Notifications
You must be signed in to change notification settings - Fork 370
Test: Add rocksdb size profiling test #1705
base: dev
Are you sure you want to change the base?
Conversation
private static final Logger log = LoggerFactory.getLogger(RocksDbSizeProfiling.class); | ||
|
||
@Test | ||
public void profileDBSectionsSize() throws Exception { |
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.
private static final Logger log = LoggerFactory.getLogger(RocksDbSizeProfiling.class); | ||
|
||
@Test | ||
public void profileDBSectionsSize() throws Exception { |
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.
package com.iota.iri.profiling; | ||
|
||
import com.iota.iri.conf.BaseIotaConfig; | ||
import com.iota.iri.controllers.*; |
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.
log.info(String.format("Total (uncompressed): %.2f GB", sum / 1073741824 /* GB */)); | ||
} finally { | ||
log.info("----------------------------"); | ||
localTangle.shutdown(); |
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.
maybe add a startup again, then log the db size on disk as well (compressed) and shutdown again.
as this restart forces rocksdb to write to disk :D
Code could be cleaner by reusing a new method for each/most VMs by accepting name, first vm and size to increase (although this is fine by me)
Description
This adds adds an old profiling code that we had for some times to IRI's codebase.
It is better to add it officially to IRI's repo because it allows us to make sure it doesn't break due to change in IRI.
The motivation for finally merging is testing #1653.
In order to run it type:
mvn -Dtest=RocksDbSizeProfiling#profileDBSectionsSize test [-Ddbpath=/some/path]
If
-Ddbpath
is missing it defaults tomainnetdb
Fixes #936
Type of change
How Has This Been Tested?
The test ran successfully
Checklist:
Please delete items that are not relevant.