
    9Yf                     B    d dl mZ d dlmZ d dlmZmZ  G d de      Zy)    )defaultdict)api)report_errorsreport_warningsc                   ,    e Zd Zed        Zed        Zy)MetricClientc                    |j                  dd      }|j                  dd      }d|_        |j                  dd	      }|j                  d
d       |j                  ddt               |j                  ddd       |j                  ddd       |j                  ddd        |j                  ddd        |j                  ddd       |j                  ddd        |j                  | j                         y ) NmetriczPost metrics.)helpVerbsverb)titledestTpostzPost metricsnamezmetric namevaluez'metric value (integer or decimal value))r   typez--hostzFscopes your metric to a specific host (default to the local host name) )r   defaultz	--no_hostz9no host is associated with the metric (overrides --host))
store_true)r   actionz--devicez'scopes your metric to a specific devicez--tagszcomma-separated list of tagsz--localhostnamezddeprecated, used to force `--host` to the local hostname (now default when no `--host` is specified)z--typezAtype of the metric - gauge(32bit float) or counter(64bit integer))func)
add_parseradd_subparsersrequiredadd_argumentfloatset_defaults_post)cls
subparsersparserverb_parserspost_parsers        W/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/datadog/dogshell/metric.pysetup_parserzMetricClient.setup_parser   s2   &&xo&F,,7,H $"--f>-J  m <  /X_d e  fpr 	! 	
 	  \eq 	! 	
 	  2[ei j  0NX\ ]  :   	! 	
 	  ako 	! 	
 	+    c           	      H   |j                   t        _        |j                  rdn|j                  }|j
                  rMt        t        |j
                  j                  d      D cg c]  }|s|j                          c}            }nd}t        j                  j                  |j                  |j                  ||j                  ||j                        }t!        t"        |      }|j$                  r|d   j'                  d       t)        |       t+        |       yc c}w )z 
        Post a metric.
        N,)r
   pointshostdevicetagsmetric_typewarningsz`--localhostname` command line flag is deprecated, made default when no `--host` is specified. See the `--host` option for more information.)timeoutr   _timeoutno_hostr+   r-   sortedsetsplitstripMetricsendr   r   r,   r   r   listlocalhostnameappendr   r   )r    argsr+   tr-   ress         r%   r   zMetricClient._post*   s     ||||t99#$))//#2FLQ!qwwyLMNDD jjoo99TZZd4;;UYgkgpgp  

 $$
O""O 	c' Ms   #D+DN)__name__
__module____qualname__classmethodr&   r    r'   r%   r   r      s(    , ,8  r'   r   N)	collectionsr   datadogr   datadog.dogshell.commonr   r   objectr   rC   r'   r%   <module>rH      s   
 $  B<6 <r'   