C++ YT Wrapper
C++ library for working with YT clusters
Loading...
Searching...
No Matches
NYT::TJobStatistics Class Reference

Class representing a collection of job statistics. More...

#include <job_statistics.h>

Public Member Functions

 TJobStatistics ()
 Construct empty statistics.
 TJobStatistics (const NYT::TNode &statistics)
 Construct statistics from statistics node.
 TJobStatistics (const TJobStatistics &jobStatistics)
 TJobStatistics (TJobStatistics &&jobStatistics) noexcept
TJobStatistics & operator= (const TJobStatistics &jobStatistics)
TJobStatistics & operator= (TJobStatistics &&jobStatistics) noexcept
TJobStatistics TaskName (TVector< TTaskName > taskNames) const
 Filter statistics by task name.
TJobStatistics JobState (TVector< EJobState > filter) const
 Filter statistics by job state.
TJobStatistics JobType (TVector< EJobType > filter) const
 Filter statistics by job type.
bool HasStatistics (TStringBuf name) const
 Check that given statistics exist.
TJobStatisticsEntry< i64 > GetStatistics (TStringBuf name) const
 Get statistics by name.
template<typename T>
TJobStatisticsEntry< T > GetStatisticsAs (TStringBuf name) const
 Get statistics by name.
TVector< TString > GetStatisticsNames () const
 Get (slash separated) names of statistics.
bool HasCustomStatistics (TStringBuf name) const
 Check if given custom statistics exists.
TJobStatisticsEntry< i64 > GetCustomStatistics (TStringBuf name) const
 Get custom statistics (those the user can write in job with NYT::WriteCustomStatistics).
template<typename T>
TJobStatisticsEntry< T > GetCustomStatisticsAs (TStringBuf name) const
 Get custom statistics (those the user can write in job with NYT::WriteCustomStatistics).
TVector< TString > GetCustomStatisticsNames () const
 Get names of all custom statistics.

Friends

template<typename T>
class TJobStatisticsEntry

Detailed Description

Class representing a collection of job statistics.

Member Function Documentation

◆ GetCustomStatistics()

TJobStatisticsEntry< i64 > NYT::TJobStatistics::GetCustomStatistics ( TStringBuf name) const

Get custom statistics (those the user can write in job with NYT::WriteCustomStatistics).

Parameters
nameSlash separated custom statistics name.

◆ GetCustomStatisticsAs()

template<typename T>
TJobStatisticsEntry< T > NYT::TJobStatistics::GetCustomStatisticsAs ( TStringBuf name) const

Get custom statistics (those the user can write in job with NYT::WriteCustomStatistics).

Parameters
nameSlash separated custom statistics name.

◆ GetStatistics()

TJobStatisticsEntry< i64 > NYT::TJobStatistics::GetStatistics ( TStringBuf name) const

Get statistics by name.

Parameters
nameSlash separated statistics name, e.g. "time/total" (like it appears in web interface).
Note
If statistics is missing an exception is thrown. If because of filters no fields remain the returned value is empty (all fields are Nothing).
We don't use TMaybe<TJobStatisticsEntry> here; instead, NYT::TJobStatisticsEntry methods return TMaybe<i64>, so user easier use .GetOrElse:
jobStatistics.GetStatistics("some/statistics/name").Max().GetOrElse(0);

◆ GetStatisticsAs()

template<typename T>
TJobStatisticsEntry< T > NYT::TJobStatistics::GetStatisticsAs ( TStringBuf name) const

Get statistics by name.

Parameters
nameSlash separated statistics name, e.g. "time/total" (like it appears in web interface).
Note
In order to use GetStatisticsAs method, NYT::ConvertJobStatisticsEntry function must be defined (the library defines it for i64 and TDuration, user may define it for other types).

◆ HasCustomStatistics()

bool NYT::TJobStatistics::HasCustomStatistics ( TStringBuf name) const

Check if given custom statistics exists.

Parameters
nameSlash separated custom statistics name.

◆ HasStatistics()

bool NYT::TJobStatistics::HasStatistics ( TStringBuf name) const

Check that given statistics exist.

Parameters
nameSlash separated statistics name, e.g. "time/total" (like it appears in web interface).

◆ JobState()

TJobStatistics NYT::TJobStatistics::JobState ( TVector< EJobState > filter) const

Filter statistics by job state.

Parameters
filterWhat job states to include (empty means all).
Note
Default statistics include only (successfully) completed jobs.

◆ JobType()

TJobStatistics NYT::TJobStatistics::JobType ( TVector< EJobType > filter) const

Filter statistics by job type.

Parameters
filterWhat job types to include (empty means all).
Deprecated
Use TJobStatistics::TaskName instead.
See also
https://ytsaurus.tech/docs/en/user-guide/data-processing/operations/jobs#obshaya-shema

◆ TaskName()

TJobStatistics NYT::TJobStatistics::TaskName ( TVector< TTaskName > taskNames) const

Filter statistics by task name.

Parameters
taskNamesWhat task names to include (empty means all).

The documentation for this class was generated from the following file: