|
4 | 4 | import { Backend } from './backend'; |
5 | 5 |
|
6 | 6 | export class Stats { |
7 | | - get backend(): Backend { |
8 | | - return this._backend; |
9 | | - } |
10 | | - |
11 | | - set backend(value: Backend) { |
12 | | - this._backend = value; |
13 | | - } |
14 | | - get type(): string { |
15 | | - return this._type; |
16 | | - } |
17 | | - |
18 | | - set type(value: string) { |
19 | | - this._type = value; |
20 | | - } |
21 | | - get key(): string { |
22 | | - return this._key; |
23 | | - } |
24 | | - |
25 | | - set key(value: string) { |
26 | | - this._key = value; |
27 | | - } |
28 | | - get errors(): number { |
29 | | - return this._errors; |
30 | | - } |
31 | | - |
32 | | - set errors(value: number) { |
33 | | - this._errors = value; |
34 | | - } |
35 | | - get calls(): number { |
36 | | - return this._calls; |
37 | | - } |
38 | | - |
39 | | - set calls(value: number) { |
40 | | - this._calls = value; |
41 | | - } |
42 | | - get samples(): number { |
43 | | - return this._samples; |
44 | | - } |
45 | | - |
46 | | - set samples(value: number) { |
47 | | - this._samples = value; |
48 | | - } |
49 | | - get duration(): number { |
50 | | - return this._duration; |
51 | | - } |
52 | | - |
53 | | - set duration(value: number) { |
54 | | - this._duration = value; |
55 | | - } |
56 | 7 | /** |
57 | 8 | * |
58 | 9 | * @param key - a String of the name of the key storing the model or script value |
@@ -86,19 +37,77 @@ export class Stats { |
86 | 37 | // the cumulative duration of executions in microseconds |
87 | 38 | private _duration: number; |
88 | 39 |
|
| 40 | + get duration(): number { |
| 41 | + return this._duration; |
| 42 | + } |
| 43 | + |
| 44 | + set duration(value: number) { |
| 45 | + this._duration = value; |
| 46 | + } |
| 47 | + |
89 | 48 | // the cumulative number of samples obtained from the 0th (batch) dimension (only applicable for RedisAI models) |
90 | 49 | private _samples: number; |
91 | 50 |
|
| 51 | + get samples(): number { |
| 52 | + return this._samples; |
| 53 | + } |
| 54 | + |
| 55 | + set samples(value: number) { |
| 56 | + this._samples = value; |
| 57 | + } |
| 58 | + |
92 | 59 | // the total number of executions |
93 | 60 | private _calls: number; |
94 | 61 |
|
| 62 | + get calls(): number { |
| 63 | + return this._calls; |
| 64 | + } |
| 65 | + |
| 66 | + set calls(value: number) { |
| 67 | + this._calls = value; |
| 68 | + } |
| 69 | + |
95 | 70 | // the total number of errors generated by executions (excluding any errors generated during parsing commands) |
96 | 71 | private _errors: number; |
97 | 72 |
|
| 73 | + get errors(): number { |
| 74 | + return this._errors; |
| 75 | + } |
| 76 | + |
| 77 | + set errors(value: number) { |
| 78 | + this._errors = value; |
| 79 | + } |
| 80 | + |
98 | 81 | private _key: string; |
| 82 | + |
| 83 | + get key(): string { |
| 84 | + return this._key; |
| 85 | + } |
| 86 | + |
| 87 | + set key(value: string) { |
| 88 | + this._key = value; |
| 89 | + } |
| 90 | + |
99 | 91 | private _type: string; |
| 92 | + |
| 93 | + get type(): string { |
| 94 | + return this._type; |
| 95 | + } |
| 96 | + |
| 97 | + set type(value: string) { |
| 98 | + this._type = value; |
| 99 | + } |
| 100 | + |
100 | 101 | private _backend: Backend; |
101 | 102 |
|
| 103 | + get backend(): Backend { |
| 104 | + return this._backend; |
| 105 | + } |
| 106 | + |
| 107 | + set backend(value: Backend) { |
| 108 | + this._backend = value; |
| 109 | + } |
| 110 | + |
102 | 111 | // tag is an optional string for tagging the model/script such as a version number or any arbitrary identifier |
103 | 112 | private _tag: string | undefined; |
104 | 113 |
|
|
0 commit comments