|
47 | 47 | "returns the number of impressions, clicks and views per interval (:daily, :weekly, :monthly or :yearly) over the given time period, |
48 | 48 | filtered by any other arguments accepted by metric-query. |
49 | 49 | |
50 | | - Date parameters must be in the format YYYY-mm-dd." |
| 50 | + Date parameters must be in the format YYYY-MM-DD." |
51 | 51 | [ds interval min-date max-date opts] |
52 | 52 | (let [select (cond |
53 | 53 | (= interval :daily) [[:date :timestamp] :day] |
|
66 | 66 | [(hsql/filter :%count.* (hsql/where := :event "impression")) :impressions] |
67 | 67 | [(hsql/filter :%count.* (hsql/where := :event "click")) :clicks] |
68 | 68 | [(hsql/filter :%count.* (hsql/where := :event "view")) :views]) |
69 | | - :min-date (str min-date " 00:00:00") |
70 | | - :max-date (str max-date " 23:59:59") |
| 69 | + :min-date (str min-date "T00:00:00Z") |
| 70 | + :max-date (str max-date "T23:59:59Z") |
71 | 71 | :group-by (hsql/group-by column) |
72 | 72 | :order-by (hsql/order-by column)} |
73 | 73 | opts)))) |
|
306 | 306 | (dotimes [_ num-records] |
307 | 307 | (seed-event! maximums))) |
308 | 308 |
|
309 | | - (time (metric-query ds {:min-date "2025-11-25 15:00:00" |
| 309 | + (time (metric-query ds {:min-date "2025-11-25T15:00:00Z" |
310 | 310 | :feed-id "1"})) |
311 | 311 |
|
312 | 312 | (time (statistics-query ds {:ret :*})) |
|
317 | 317 |
|
318 | 318 | (time (hon/update! ds {:tname :events |
319 | 319 | :where [:between :id 5000000 5500000] |
320 | | - :data {:timestamp (str "2025-11-22" " 13:00:00")} |
| 320 | + :data {:timestamp (str "2025-11-22" "T13:00:00Z")} |
321 | 321 | :ret :*})) |
322 | 322 |
|
323 | 323 | (time (hon/execute! ds (-> (hsql/select [[:date :timestamp] :day] |
324 | 324 | [(hsql/filter :%count.* (hsql/where := :event "impression")) :impressions] |
325 | 325 | [(hsql/filter :%count.* (hsql/where := :event "click")) :clicks] |
326 | 326 | [(hsql/filter :%count.* (hsql/where := :event "view")) :views]) |
327 | 327 | (hsql/from :events) |
328 | | - (hsql/where [:between :timestamp "2025-11-17 00:00:00" "2025-11-24 23:59:59"]) |
| 328 | + (hsql/where [:between :timestamp "2025-11-17T00:00:00Z" "2025-11-24T23:59:59Z"]) |
329 | 329 | (hsql/group-by :day) |
330 | 330 | (hsql/order-by :day)) {:ret :*})) |
331 | 331 |
|
|
336 | 336 | [(hsql/filter :%count.* (hsql/where := :event "click")) :clicks] |
337 | 337 | [(hsql/filter :%count.* (hsql/where := :event "view")) :views]) |
338 | 338 | (hsql/from :events) |
339 | | - (hsql/where [:between :timestamp "2025-11-01 00:00:00" "2025-11-30 23:59:00"]) |
| 339 | + (hsql/where [:between :timestamp "2025-11-01T00:00:00Z" "2025-11-30T23:59:00Z"]) |
340 | 340 | (hsql/group-by :week) |
341 | 341 | (hsql/order-by :week)) |
342 | 342 | {:ret :*})) |
|
347 | 347 |
|
348 | 348 | (time (weekly-growth-averages ds "2025-11-01" "2025-11-30" {:feed-id 4})) |
349 | 349 |
|
350 | | - (time (average-engagement ds "2025-11-24 00:00:00" "2025-11-24 23:59:59" {:feed-id 4})) |
| 350 | + (time (average-engagement ds "2025-11-24T00:00:00Z" "2025-11-24T23:59:59Z" {:feed-id 4})) |
351 | 351 |
|
352 | | - (time (click-through-rate ds {:min-date "2025-11-24 00:00:00" |
353 | | - :max-date "2025-11-24 23:59:59" |
| 352 | + (time (click-through-rate ds {:min-date "2025-11-24T00:00:00Z" |
| 353 | + :max-date "2025-11-24T23:59:59Z" |
354 | 354 | :feed-id 4})) |
355 | 355 |
|
356 | 356 | (time |
|
0 commit comments