!sR*BddlZddlmZmZddlZddlmZmZdZddZdS)N)datetime timedelta)check_timestamp period_type2 c tjdddtj}|ptj|dt jddd|d d d d tt z d dd| }|ddd d d |ddfdd|dtd| }|dddd t!|d"d#d$d %|d&d'd(d)d *|d+d,d-d./|d0d1d2d)d *|d3d4d)d *|d5td6d78|}|d9d:d)d *|d;d?|S)@Nzlve-read-snapshotTz-Reads lve system state snapshots for LVE/user)progadd_help descriptionformatter_classz --versionzVersion numberversion)r helpdestactionz-fz--from+zeRun report from date and time in YYYY-MM-DD HH:MM format; if not present, last 10 minutes are assumed)minutesz%Y-%m-%d %H:%MffromFROM)nargsrdefaultrmetavarz-tz--tozdRun report up to date and time in YYYY-MM-DD HH:MM format; if not present, reports results up to now)rrrz-pz--periodc&t|dS)NF)r)valuenows /builddir/build/BUILDROOT/lve-stats-4.3.2-1.el9.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/parsers/lve_read_snapshot_argparse.pyz*lve_read_snapshot_parser..:s<sE::zTime period. Specify minutes with 'm', hours with 'h', days with 'd', and values: today, yesterday. Examples: 5m - last 5 minutes, 4h - last four hours, 2d - last 2 days, as well as today)typerz --timestampz,Timestamp in Unix format to get one snapshotz-iz--idzLVE ID to show records forF)rrequiredrz-uz--userz User account to show records for)rrz-lz--listzShow timestamp list only store_true)rrrz-oz--outputzRFilename to save snapshot report to; if not present, output will be sent to STDOUTfile)rrz-jz--jsonzOutput in JSON formatz --compactzJTruncate SQL queries for reduced memory usage (useful for large snapshots)z--snap-sql-itemzGet specific SQL query by index from the snapshot's database queries list. Only works when using --timestamp and --json options togetherINDEX)rrrz--statsz!Output stats instead of snapshotsz--unitz}Group stats by time unit. Example values: 3h, 24h, 1d, 1w. Alternative possible value is 'auto' for grouping by each incidentunit1d)rrr)argparseArgumentParserArgumentDefaultsHelpFormatterrr add_argumentlvestats __version__rDEFAULT_PERIOD_MINUTESstrftimesplitadd_mutually_exclusive_grouprintadd_argument_group)now_parser period_parser user_parser stats_parserrs @rlve_read_snapshot_parserr6s'  $ C > F  (,..C $      ty)?@@@@JJK[\\bbdd 7799M  s -..4466   : : : : 1      ; 5577KT60LW\cfgggT82T_deee   '    a    $   Y    L,,..L 0  Q Mr)N) r%rrr)#lvestats.lib.commons.argparse_utilsrrr+r6rrr9ss((((((((MMMMMMMMvvvvvvr