Documentation
¶
Index ¶
- Constants
- func CalculatePercentile(latencies []time.Duration, percentile float64) time.Duration
- func CreateFile(outputDir string, fileName string) (*os.File, error)
- func ListAllFiles(dir string) ([]string, error)
- func OpenDB(dir string) (dbm.DB, error)
- func PickRandomKVFile(inputKVDir string, processedFiles *sync.Map) string
- func RandomShuffle(kvPairs []KeyValuePair)
- func ReadTree(db dbm.DB, version int, prefix []byte) (*iavl.MutableTree, error)
- func WriteTreeDataToFile(tree *iavl.MutableTree, filenamePattern string, chunkSize int)
- type ContractSizeEntry
- type DynamoDBClient
- type KeyValuePair
- type PrefixSize
- type StateSizeAnalysis
Constants ¶
const (
DefaultCacheSize int = 10000
)
Variables ¶
This section is empty.
Functions ¶
func CalculatePercentile ¶
NOTE: Assumes latencies is sorted CalculatePercentile calculates latencies percentile
func ListAllFiles ¶
func PickRandomKVFile ¶
Picks random file from input kv dir and updates processedFiles Map with it
func ReadTree ¶
ReadTree loads an iavl tree from the directory If version is 0, load latest, otherwise, load named version The prefix represents which iavl tree you want to read. The iaviwer will always set a prefix.
func WriteTreeDataToFile ¶
func WriteTreeDataToFile(tree *iavl.MutableTree, filenamePattern string, chunkSize int)
Writes raw key / values from a tree to a file Writes a chunkSize number of keys/values to separate files per module
Types ¶
type ContractSizeEntry ¶
type ContractSizeEntry struct {
Address string `json:"address"`
TotalSize uint64 `json:"total_size"`
KeyCount uint64 `json:"key_count"`
}
ContractSizeEntry represents individual contract size data
type DynamoDBClient ¶
type DynamoDBClient struct {
// contains filtered or unexported fields
}
DynamoDBClient wraps the DynamoDB service with common operations
func NewDynamoDBClient ¶
func NewDynamoDBClient(tableName, awsRegion string) (*DynamoDBClient, error)
NewDynamoDBClient creates a new DynamoDB client
func (*DynamoDBClient) ExportMultipleAnalyses ¶
func (d *DynamoDBClient) ExportMultipleAnalyses(analyses []*StateSizeAnalysis) error
ExportMultipleAnalyses exports multiple analyses sequentially
func (*DynamoDBClient) ExportStateSizeAnalysis ¶
func (d *DynamoDBClient) ExportStateSizeAnalysis(analysis *StateSizeAnalysis) error
ExportStateSizeAnalysis exports a single module analysis to DynamoDB
func (*DynamoDBClient) UpdateLatestHeightIfGreater ¶
func (d *DynamoDBClient) UpdateLatestHeightIfGreater(metadataTable string, height int64) (bool, error)
UpdateLatestHeightIfGreater keeps exactly one item in the metadata table using the schema: Partition key: keyname (S). Numeric attribute: height (N) stores the latest height. Upserts the row keyname = "latest_height" and sets height = :h only if missing or lower.
type KeyValuePair ¶
func LoadAndShuffleKV ¶
func LoadAndShuffleKV(inputDir string, concurrency int) ([]KeyValuePair, error)
func ReadKVEntriesFromFile ¶
func ReadKVEntriesFromFile(filename string) ([]KeyValuePair, error)
Reads raw keys / values from a file
type PrefixSize ¶
type PrefixSize struct {
KeySize uint64 `json:"key_size"`
ValueSize uint64 `json:"value_size"`
TotalSize uint64 `json:"total_size"`
KeyCount uint64 `json:"key_count"`
}
PrefixSize is a helper structure kept for completeness (unused here)
type StateSizeAnalysis ¶
type StateSizeAnalysis struct {
BlockHeight int64 `json:"block_height" dynamodbav:"block_height"`
ModuleName string `json:"module_name" dynamodbav:"module_name"`
TotalNumKeys uint64 `json:"total_num_keys" dynamodbav:"total_num_keys"`
TotalKeySize uint64 `json:"total_key_size" dynamodbav:"total_key_size"`
TotalValueSize uint64 `json:"total_value_size" dynamodbav:"total_value_size"`
TotalSize uint64 `json:"total_size" dynamodbav:"total_size"`
PrefixBreakdown string `json:"prefix_breakdown" dynamodbav:"prefix_breakdown"`
ContractBreakdown string `json:"contract_breakdown" dynamodbav:"contract_breakdown"`
}
StateSizeAnalysis represents the analysis data to be stored in DynamoDB