Dump SOW File

amps_sow_dump is a utility used to inspect the contents of a SOW topic store. Additionally, it can be used to gather summary statistics on a SOW file.

Options and Parameters

Option
Description

filename (required)

Filename of the SOW file.

-n LIMIT

Maximum number of records to print per file.

-v, --verbose

Print record metadata for records and file summary.

--sizing-chart

Print memory sizing chart for efficiency comparison (experimental).

-d DELIMITER

Prints only the record data using the provided ASCII character value as the record delimiter [default: 10 for newline].

--version

Show the version number of the program and exit.

-h, --help

Show the help message and exit.

Usage

The following listing shows a simple sow dump of a json format topic. Each key which exists in the order.sow file is dumped out to stdout. This output can easily be redirected to a new file, or piped into another program for further analysis.

amps_sow_dump expects a filename at a minimum in order to complete the SOW topic store dump process.

%> ./amps_sow_dump ./order.sow

{ "id": 0, "value": 1743 }
{ "id": 1, "value": 6554 }
{ "id": 2, "value": 3243 }
{ "id": 3, "value": 5332 }
{ "id": 4, "value": 3725 }
{ "id": 5, "value": 1598 }
{ "id": 6, "value": 6094 }
{ "id": 7, "value": 7524 }
{ "id": 8, "value": 2432 }
{ "id": 9, "value": 9669 }
{ "id": 10, "value": 140 }

Verbose Output

The amps_sow_dump utility also provides for verbose output, which will display more information about the file and its structure in addition to the records contained in the file.

# This is the last record reported by amps_sow_dump for this sample SOW file.
key                   = 5617746317001299819
    crc               = 1746452067
    flags             = 
    slab offset       = 4096
    allocated         = 128
    data size         = 26
    expiration        = 0
    iso8601 timestamp = 20240819T222516.604685Z
    local txid        = 1724106311000000013
    string key        = []
    correlation id    = []
    data              = [{ "id": 10, "value": 140 }]
   
File                : sow/order.sow
    Version             :        amps-sow-v3.0
    Valid Keys          :                   11
    Record Size         :                  128
    Maximum Records     :                   11
    Multirecords        :                    0
    Maximum record size :                   26
    Average record size :                26.00
    Slab Count          :                    1

    Slab Detail

size              :              5259264
    file offset   :                 4096
    valid count   :                   11
    invalid count :                    1
    stored bytes  :                 1408
    data bytes    :                  286
    deleted bytes :              5257728

Sizing Chart

The example below shows the output from the --sizing-chart flag. This is feature can be useful in tuning AMPS memory usage and performance. The Record Size with the asterisk shows the current Record Size setting and allows an AMPS administrator to compare memory usage efficiency along with the potential for a multi-record penalty.

%> ./amps_sow_dump --sizing-chart ./order.sow

=============================================================
   Record Size           Store     Efficiency   Multirecords
=============================================================
 128           128 B        100.00%              0
 256           256 B         50.00%              0
 384           384 B         33.33%              0
 512*          512 B         25.00%              0
 640           640 B         20.00%              0
 768           768 B         16.67%              0
 896           896 B         14.29%              0
1024          1024 B         12.50%              0
1152         1.12 KB         11.11%              0
1280         1.25 KB         10.00%              0
1408         1.38 KB          9.09%              0
1536         1.50 KB          8.33%              0
1664         1.62 KB          7.69%              0
1792         1.75 KB          7.14%              0
1920         1.88 KB          6.67%              0

Last updated