|
| 1 | +#------------------------------------------------------------------------------- |
| 2 | +# Copyright (c) 2024 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. |
| 3 | +# |
| 4 | +# This program and the accompanying materials |
| 5 | +# are made available under the terms of the GNU Public License v3.0. |
| 6 | +# |
| 7 | +# You should have received a copy of the GNU General Public License |
| 8 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 9 | +#------------------------------------------------------------------------------- |
| 10 | + |
| 11 | +# |
| 12 | +# Set up |
| 13 | +# |
| 14 | + |
| 15 | +context("ds.mean::perf::setup") |
| 16 | +connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) |
| 17 | + |
| 18 | +# |
| 19 | +# Tests |
| 20 | +# |
| 21 | + |
| 22 | +context("ds.mean::perf::combine:0") |
| 23 | +test_that("combine - performance", { |
| 24 | + .durationSec <- 30 # seconds |
| 25 | + .count <- 0 |
| 26 | + .start.time <- Sys.time() |
| 27 | + .current.time <- .start.time |
| 28 | + |
| 29 | + while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) { |
| 30 | + ds.mean("D$LAB_TSC", type='combine') |
| 31 | + |
| 32 | + .count <- .count + 1 |
| 33 | + .current.time <- Sys.time() |
| 34 | + } |
| 35 | + expect_true(TRUE) |
| 36 | + |
| 37 | + print(paste("ds.mean::perf::combine::0:", format(.count / (difftime(.current.time, .start.time, units = "secs")[[1]]), digits = 8))) |
| 38 | +}) |
| 39 | + |
| 40 | +context("ds.mean::perf::split:0") |
| 41 | +test_that("split - performance", { |
| 42 | + .durationSec <- 30 # seconds |
| 43 | + .count <- 0 |
| 44 | + .start.time <- Sys.time() |
| 45 | + .current.time <- .start.time |
| 46 | + |
| 47 | + while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) { |
| 48 | + ds.mean("D$LAB_TSC", type='split') |
| 49 | + |
| 50 | + .count <- .count + 1 |
| 51 | + .current.time <- Sys.time() |
| 52 | + } |
| 53 | + expect_true(TRUE) |
| 54 | + |
| 55 | + print(paste("ds.mean::perf::split::0:", format(.count / (difftime(.current.time, .start.time, units = "secs")[[1]]), digits = 8))) |
| 56 | +}) |
| 57 | + |
| 58 | +# |
| 59 | +# Done |
| 60 | +# |
| 61 | + |
| 62 | +context("ds.mean::perf::shutdown") |
| 63 | +disconnect.studies.dataset.cnsim() |
| 64 | +context("ds.mean::perf::done") |
0 commit comments