���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/parsers/lve_read_snapshot_argparse.py
���ѧ٧ѧ�
# coding=utf-8 # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT import argparse from datetime import datetime, timedelta import lvestats from lvestats.lib.commons.argparse_utils import check_timestamp, period_type2 DEFAULT_PERIOD_MINUTES = 10 def lve_read_snapshot_parser(now_=None): parser = argparse.ArgumentParser( prog="lve-read-snapshot", add_help=True, description="Reads lve system state snapshots for LVE/user", formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) now = now_ or datetime.now() parser.add_argument( "--version", version=lvestats.__version__, help="Version number", dest="version", action="version", ) parser.add_argument( "-f", "--from", nargs="+", help="Run report from date and time in YYYY-MM-DD HH:MM format; if not present, last 10 minutes are assumed", default=(now - timedelta(minutes=DEFAULT_PERIOD_MINUTES)).strftime("%Y-%m-%d %H:%M").split(), dest="ffrom", metavar="FROM", ) period_parser = parser.add_mutually_exclusive_group() period_parser.add_argument( "-t", "--to", nargs="+", help="Run report up to date and time in YYYY-MM-DD HH:MM format; if not present, reports results up to now", default=now.strftime("%Y-%m-%d %H:%M").split(), ) period_parser.add_argument( "-p", "--period", type=lambda value: period_type2(value, now, False), help=( "Time 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" ), ) period_parser.add_argument( "--timestamp", type=check_timestamp, help="Timestamp in Unix format to get one snapshot", ) user_parser = parser.add_mutually_exclusive_group() # Mutually exclusive: use either -i or -u user_parser.add_argument("-i", "--id", help="LVE ID to show records for", required=False, type=int) user_parser.add_argument("-u", "--user", help="User account to show records for", required=False) parser.add_argument( "-l", "--list", help="Show timestamp list only", action="store_true", default=False, ) parser.add_argument( "-o", "--output", help="Filename to save snapshot report to; if not present, output will be sent to STDOUT", metavar="file", ) parser.add_argument( "-j", "--json", help="Output in JSON format", action="store_true", default=False, ) parser.add_argument( "--compact", help="Truncate SQL queries for reduced memory usage (useful for large snapshots)", action="store_true", default=False, ) parser.add_argument( "--snap-sql-item", type=int, help=( "Get specific SQL query by index from the snapshot's database queries list. " "Only works when using --timestamp and --json options together" ), metavar="INDEX", ) stats_parser = parser.add_argument_group() stats_parser.add_argument( "--stats", help="Output stats instead of snapshots", action="store_true", default=False, ) stats_parser.add_argument( "--unit", help=( "Group stats by time unit. Example values: 3h, 24h, 1d, 1w. " "Alternative possible value is 'auto' for grouping by each incident" ), metavar="unit", default="1d", ) return parser
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�