blob: 573cbe47844d148c0babaaa0c13fcd1b3ad38605 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#pragma once
#include "fwd.h"
#include <yt/cpp/mapreduce/interface/node.h>
namespace NYT {
class TJobCounter
{
private:
TNode Data_;
ui64 Total_ = 0;
public:
TJobCounter() = default;
TJobCounter(TNode data);
TJobCounter(ui64 total);
ui64 GetTotal() const;
ui64 GetValue(const TStringBuf key) const;
};
/// Class representing a collection of job counters.
class TJobCounters
{
public:
///
/// Construct empty counter.
TJobCounters() = default;
///
/// Construct counter from counters node.
TJobCounters(const TNode& counters);
const TJobCounter& GetAborted() const;
const TJobCounter& GetAbortedScheduled() const;
const TJobCounter& GetAbortedNonScheduled() const;
const TJobCounter& GetCompleted() const;
const TJobCounter& GetCompletedNonInterrupted() const;
const TJobCounter& GetCompletedInterrupted() const;
const TJobCounter& GetLost() const;
const TJobCounter& GetInvalidated() const;
const TJobCounter& GetFailed() const;
const TJobCounter& GetRunning() const;
const TJobCounter& GetSuspended() const;
const TJobCounter& GetPending() const;
const TJobCounter& GetBlocked() const;
ui64 GetTotal() const;
private:
ui64 Total_ = 0;
TJobCounter Aborted_;
TJobCounter AbortedScheduled_;
TJobCounter AbortedNonScheduled_;
TJobCounter Completed_;
TJobCounter CompletedNonInterrupted_;
TJobCounter CompletedInterrupted_;
TJobCounter Lost_;
TJobCounter Invalidated_;
TJobCounter Failed_;
TJobCounter Running_;
TJobCounter Suspended_;
TJobCounter Pending_;
TJobCounter Blocked_;
};
////////////////////////////////////////////////////////////////////
} // namespace NYT
|