Friendly Amazon Kinesis Stream Command Line Interface
Project description
Kines
Friendly Amazon Kinesis Stream Command Line Interface
Install
pip install kines
Setup
aws configure
Features
List all Kinesis Stream
kines ls
> kines ls
Found 20 streams.
┌──────────────────────────────────────┬───┬────┬────┬──────┐
│ Status - Stream │ # │ 👥 │ 🕑 │ 🔑 │
├──────────────────────────────────────┼───┼────┼────┼──────┤
│ ⛹ prod-clickstream │ 8 │ 0 │ 24 │ NONE │
│ ⛹ uat-clickstream │ 1 │ 0 │ 24 │ NONE │
└──────────────────────────────────────┴───┴────┴────┴──────┘
List Kinesis Stream Shards
kines lss <stream-name>
> kines lss prod-clickstream
┌─────────────────┬───────────────┬───────────────────────┬────────────────┐
│ ShardId │ ParentShardId │ AdjacentParentShardId │ % HashKeyRange │
├─────────────────┼───────────────┼───────────────────────┼────────────────┤
│ 📖 000000000007 │ 000000000003 │ │ 12.5% │
│ 📖 000000000008 │ 000000000003 │ │ 12.5% │
│ 📖 000000000009 │ 000000000004 │ │ 12.5% │
│ 📖 000000000010 │ 000000000004 │ │ 12.5% │
│ 📖 000000000011 │ 000000000005 │ │ 12.5% │
│ 📖 000000000012 │ 000000000005 │ │ 12.5% │
│ 📖 000000000013 │ 000000000006 │ │ 12.5% │
│ 📖 000000000014 │ 000000000006 │ │ 12.5% │
└─────────────────┴───────────────┴───────────────────────┴────────────────┘
- For detailed output Run
kines lss <stream-name> -d
> kines lss prod-clickstream -d
┌─────────────────┬───────────────┬───────────────────────┬────────────────┬─────────────────────────────────────────┬─────────────────────────────────────────┐
│ ShardId │ ParentShardId │ AdjacentParentShardId │ % HashKeyRange │ StartingHashKey │ EndingHashKey │
├─────────────────┼───────────────┼───────────────────────┼────────────────┼─────────────────────────────────────────┼─────────────────────────────────────────┤
│ 📖 000000000007 │ 000000000003 │ │ 12.5% │ 0 │ 42535295865117307932921825928971026431 │
│ 📖 000000000008 │ 000000000003 │ │ 12.5% │ 42535295865117307932921825928971026432 │ 85070591730234615865843651857942052863 │
│ 📖 000000000009 │ 000000000004 │ │ 12.5% │ 85070591730234615865843651857942052864 │ 127605887595351923798765477786913079295 │
│ 📖 000000000010 │ 000000000004 │ │ 12.5% │ 127605887595351923798765477786913079296 │ 170141183460469231731687303715884105727 │
│ 📖 000000000011 │ 000000000005 │ │ 12.5% │ 170141183460469231731687303715884105728 │ 212676479325586539664609129644855132159 │
│ 📖 000000000012 │ 000000000005 │ │ 12.5% │ 212676479325586539664609129644855132160 │ 255211775190703847597530955573826158591 │
│ 📖 000000000013 │ 000000000006 │ │ 12.5% │ 255211775190703847597530955573826158592 │ 297747071055821155530452781502797185023 │
│ 📖 000000000014 │ 000000000006 │ │ 12.5% │ 297747071055821155530452781502797185024 │ 340282366920938463463374607431768211455 │
└─────────────────┴───────────────┴───────────────────────┴────────────────┴─────────────────────────────────────────┴─────────────────────────────────────────┘
Find shard for partition key
kines find prod-clickstream -p 123455 -p 8900
> kines find prod-clickstream -p 123455 -p 8900
┌──────────────┬──────────────────────────────────┬─────────────────────────────────────────┬─────────────────┐
│ PartitionKey │ MD5PartitionKey │ HashKey │ ShardId │
├──────────────┼──────────────────────────────────┼─────────────────────────────────────────┼─────────────────┤
│ 123455 │ 00c66aaf5f2c3f49946f15c1ad2ea0d3 │ 1030238607790890479260410494606811347 │ 📖 000000000007 │
│ 8900 │ eedc6ed006e6f49a7010013cc1fd8a3f │ 317500815852337962583846441353507342911 │ 📖 000000000014 │
└──────────────┴──────────────────────────────────┴─────────────────────────────────────────┴─────────────────┘
Get report for your Kinesis Stream
kines report <stream-name> -h <number-of-hours> -p <metric-period-in-minutes>
kines report -s prod-clickstream -h 3
┌──────────────────┬─────────┬───────────┬────────┬──────────┬────────┬───────┬──────┬─────────┬───────────┐
│ Time │ IR │ IS │ IR/Sec │ GR │ GR/Sec │ GR/IR │ WPTE │ RPTE │ MAX(IAGM) │
├──────────────────┼─────────┼───────────┼────────┼──────────┼────────┼───────┼──────┼─────────┼───────────┤
│ 2019-09-23 13:30 │ 63564.0 │ 192.4 MB │ 70.63 │ 444774.0 │ 494.19 │ 7.00 │ 0.0 │ 6.0 🔥 │ 0.0 │
│ 2019-09-23 13:45 │ 65641.0 │ 198.67 MB │ 72.93 │ 459252.0 │ 510.28 │ 7.00 │ 0.0 │ 7.0 🔥 │ 0.0 │
│ 2019-09-23 14:00 │ 65451.0 │ 198.45 MB │ 72.72 │ 458541.0 │ 509.49 │ 7.01 │ 0.0 │ 1.0 🔥 │ 0.0 │
│ 2019-09-23 14:15 │ 66479.0 │ 202.04 MB │ 73.87 │ 465438.0 │ 517.15 │ 7.00 │ 0.0 │ 5.0 🔥 │ 0.0 │
│ 2019-09-23 14:30 │ 71354.0 │ 216.3 MB │ 79.28 │ 499529.0 │ 555.03 │ 7.00 │ 0.0 │ 2.0 🔥 │ 0.0 │
│ 2019-09-23 14:45 │ 71284.0 │ 216.07 MB │ 79.20 │ 498896.0 │ 554.33 │ 7.00 │ 0.0 │ 4.0 🔥 │ 0.0 │
│ 2019-09-23 15:00 │ 98094.0 │ 293.68 MB │ 108.99 │ 686561.0 │ 762.85 │ 7.00 │ 0.0 │ 8.0 🔥 │ 0.0 │
│ 2019-09-23 15:15 │ 85521.0 │ 258.77 MB │ 95.02 │ 598670.0 │ 665.19 │ 7.00 │ 0.0 │ 2.0 🔥 │ 0.0 │
│ 2019-09-23 15:30 │ 78926.0 │ 236.83 MB │ 87.70 │ 552504.0 │ 613.89 │ 7.00 │ 0.0 │ 2.0 🔥 │ 0.0 │
│ 2019-09-23 15:45 │ 82719.0 │ 251.19 MB │ 91.91 │ 578759.0 │ 643.07 │ 7.00 │ 0.0 │ 14.0 🔥 │ 0.0 │
│ 2019-09-23 16:00 │ 75329.0 │ 228.95 MB │ 83.70 │ 527481.0 │ 586.09 │ 7.00 │ 0.0 │ 2.0 🔥 │ 0.0 │
│ 2019-09-23 16:15 │ 73013.0 │ 221.95 MB │ 81.13 │ 511282.0 │ 568.09 │ 7.00 │ 0.0 │ 5.0 🔥 │ 0.0 │
│ 2019-09-23 16:30 │ 73048.0 │ 222.1 MB │ 81.16 │ 511147.0 │ 567.94 │ 7.00 │ 0.0 │ 2.0 🔥 │ 0.0 │
│ 2019-09-23 16:45 │ 54229.0 │ 165.09 MB │ 60.25 │ 379756.0 │ 421.95 │ 7.00 │ 0.0 │ 2.0 🔥 │ 0.0 │
└──────────────────┴─────────┴───────────┴────────┴──────────┴────────┴───────┴──────┴─────────┴───────────┘
How to build in Dev?
venv/bin/kines_cli
. venv/bin/activate
pip install --editable .
How to publish to pypi?
python3 setup.py sdist bdist_wheel
twine upload --skip-existing dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kines-0.0.6.tar.gz
(9.6 kB
view hashes)
Built Distribution
kines-0.0.6-py3-none-any.whl
(16.1 kB
view hashes)