@@ -22,7 +22,7 @@ public function servers()
22
22
'cpu ' => (int ) $ server ['cpu ' ],
23
23
'memory_used ' => (int ) $ server ['memory_used ' ],
24
24
'memory_total ' => (int ) $ server ['memory_total ' ],
25
- 'storage ' => json_decode ($ server ['storage ' ])
25
+ 'storage ' => json_decode ($ server ['storage ' ]),
26
26
])
27
27
->values ();
28
28
@@ -44,7 +44,7 @@ public function userRequestCounts()
44
44
RedisAdapter::zunionstore (
45
45
'pulse_user_request_counts:7-day ' ,
46
46
collect (range (0 , 6 ))
47
- ->map (fn ($ days ) => 'pulse_user_request_counts: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
47
+ ->map (fn ($ days ) => 'pulse_user_request_counts: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
48
48
->toArray ()
49
49
);
50
50
@@ -72,25 +72,25 @@ public function slowEndpoints()
72
72
RedisAdapter::zunionstore (
73
73
'pulse_slow_endpoint_request_counts:7-day ' ,
74
74
collect (range (0 , 6 ))
75
- ->map (fn ($ days ) => 'pulse_slow_endpoint_request_counts: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
75
+ ->map (fn ($ days ) => 'pulse_slow_endpoint_request_counts: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
76
76
->toArray (),
77
- 'SUM '
77
+ 'SUM '
78
78
);
79
79
80
80
RedisAdapter::zunionstore (
81
81
'pulse_slow_endpoint_total_durations:7-day ' ,
82
82
collect (range (0 , 6 ))
83
- ->map (fn ($ days ) => 'pulse_slow_endpoint_total_durations: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
83
+ ->map (fn ($ days ) => 'pulse_slow_endpoint_total_durations: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
84
84
->toArray (),
85
- 'SUM '
85
+ 'SUM '
86
86
);
87
87
88
88
RedisAdapter::zunionstore (
89
89
'pulse_slow_endpoint_slowest_durations:7-day ' ,
90
90
collect (range (0 , 6 ))
91
- ->map (fn ($ days ) => 'pulse_slow_endpoint_slowest_durations: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
91
+ ->map (fn ($ days ) => 'pulse_slow_endpoint_slowest_durations: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
92
92
->toArray (),
93
- 'MAX '
93
+ 'MAX '
94
94
);
95
95
96
96
$ requestCounts = RedisAdapter::zrevrange ('pulse_slow_endpoint_request_counts:7-day ' , 0 , -1 , true );
@@ -119,9 +119,9 @@ public function usersExperiencingSlowEndpoints()
119
119
RedisAdapter::zunionstore (
120
120
'pulse_slow_endpoint_user_counts:7-day ' ,
121
121
collect (range (0 , 6 ))
122
- ->map (fn ($ days ) => 'pulse_slow_endpoint_user_counts: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
122
+ ->map (fn ($ days ) => 'pulse_slow_endpoint_user_counts: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
123
123
->toArray (),
124
- 'SUM '
124
+ 'SUM '
125
125
);
126
126
127
127
$ userCounts = collect (RedisAdapter::zrevrange ('pulse_slow_endpoint_user_counts:7-day ' , 0 , -1 , true ));
@@ -148,25 +148,25 @@ public function slowQueries()
148
148
RedisAdapter::zunionstore (
149
149
'pulse_slow_query_execution_counts:7-day ' ,
150
150
collect (range (0 , 6 ))
151
- ->map (fn ($ days ) => 'pulse_slow_query_execution_counts: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
151
+ ->map (fn ($ days ) => 'pulse_slow_query_execution_counts: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
152
152
->toArray (),
153
- 'SUM '
153
+ 'SUM '
154
154
);
155
155
156
156
RedisAdapter::zunionstore (
157
157
'pulse_slow_query_total_durations:7-day ' ,
158
158
collect (range (0 , 6 ))
159
- ->map (fn ($ days ) => 'pulse_slow_query_total_durations: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
159
+ ->map (fn ($ days ) => 'pulse_slow_query_total_durations: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
160
160
->toArray (),
161
- 'SUM '
161
+ 'SUM '
162
162
);
163
163
164
164
RedisAdapter::zunionstore (
165
165
'pulse_slow_query_slowest_durations:7-day ' ,
166
166
collect (range (0 , 6 ))
167
- ->map (fn ($ days ) => 'pulse_slow_query_slowest_durations: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
167
+ ->map (fn ($ days ) => 'pulse_slow_query_slowest_durations: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
168
168
->toArray (),
169
- 'MAX '
169
+ 'MAX '
170
170
);
171
171
172
172
$ executionCounts = RedisAdapter::zrevrange ('pulse_slow_query_execution_counts:7-day ' , 0 , -1 , true );
@@ -175,7 +175,6 @@ public function slowQueries()
175
175
176
176
return collect ($ executionCounts )
177
177
->map (function ($ executionCount , $ sql ) use ($ totalDurations , $ slowestDurations ) {
178
-
179
178
return [
180
179
'sql ' => $ sql ,
181
180
'execution_count ' => (int ) $ executionCount ,
@@ -189,11 +188,11 @@ public function slowQueries()
189
188
public function cacheStats ()
190
189
{
191
190
$ hits = collect (range (0 , 6 ))
192
- ->map (fn ($ days ) => RedisAdapter::get ('pulse_cache_hits: ' . now ()->subDays ($ days )->format ('Y-m-d ' )))
191
+ ->map (fn ($ days ) => RedisAdapter::get ('pulse_cache_hits: ' . now ()->subDays ($ days )->format ('Y-m-d ' )))
193
192
->sum ();
194
193
195
194
$ misses = collect (range (0 , 6 ))
196
- ->map (fn ($ days ) => RedisAdapter::get ('pulse_cache_misses: ' . now ()->subDays ($ days )->format ('Y-m-d ' )))
195
+ ->map (fn ($ days ) => RedisAdapter::get ('pulse_cache_misses: ' . now ()->subDays ($ days )->format ('Y-m-d ' )))
197
196
->sum ();
198
197
199
198
$ total = $ hits + $ misses ;
@@ -216,17 +215,17 @@ public function exceptions()
216
215
RedisAdapter::zunionstore (
217
216
'pulse_exception_counts:7-day ' ,
218
217
collect (range (0 , 6 ))
219
- ->map (fn ($ days ) => 'pulse_exception_counts: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
218
+ ->map (fn ($ days ) => 'pulse_exception_counts: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
220
219
->toArray (),
221
- 'SUM '
220
+ 'SUM '
222
221
);
223
222
224
223
RedisAdapter::zunionstore (
225
224
'pulse_exception_last_occurrences:7-day ' ,
226
225
collect (range (0 , 6 ))
227
- ->map (fn ($ days ) => 'pulse_exception_last_occurrences: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
226
+ ->map (fn ($ days ) => 'pulse_exception_last_occurrences: ' . now ()->subDays ($ days )->format ('Y-m-d ' ))
228
227
->toArray (),
229
- 'MAX '
228
+ 'MAX '
230
229
);
231
230
232
231
$ exceptionCounts = RedisAdapter::zrevrange ('pulse_exception_counts:7-day ' , 0 , -1 , true );
0 commit comments