Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Test: Add rocksdb size profiling test #1705

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

GalRogozinski
Copy link
Contributor

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 to mainnetdb

Fixes #936

Type of change

  • Test addition

How Has This Been Tested?

The test ran successfully

Checklist:

Please delete items that are not relevant.

  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@GalRogozinski GalRogozinski added the C-Tests This PR adds testing functionality label Jan 12, 2020
private static final Logger log = LoggerFactory.getLogger(RocksDbSizeProfiling.class);

@Test
public void profileDBSectionsSize() throws Exception {
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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.*;
Copy link
Contributor Author

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();
Copy link
Contributor

@kwek20 kwek20 Feb 12, 2020

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-Tests This PR adds testing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a tool that counts the size of each column family
2 participants