public Usage metrics(boolean details) {
        ZonedDateTime to = ZonedDateTime.now();

        ZonedDateTime from = to
            .toLocalDate()
            .atStartOfDay(ZoneId.systemDefault())
            .minusDays(1);

        return metrics(details, from, to);
    }
@Test
    public void metrics() throws URISyntaxException {
        ImmutableMap<String, Object> properties = ImmutableMap.of("kestra.server-type", ServerType.WEBSERVER.name());

        try (ApplicationContext applicationContext = Helpers.applicationContext(properties).start()) {
            CollectorService collectorService = applicationContext.getBean(CollectorService.class);
            Usage metrics = collectorService.metrics(true);

            assertThat(metrics.getUri(), is("https://mysuperhost.com/subpath"));

            assertThat(metrics.getUuid(), notNullValue());
            assertThat(metrics.getVersion(), notNullValue());
            assertThat(metrics.getStartTime(), notNullValue());
            assertThat(metrics.getEnvironments(), contains("test"));
            assertThat(metrics.getStartTime(), notNullValue());
            assertThat(metrics.getHost().getUuid(), notNullValue());
            assertThat(metrics.getHost().getHardware().getLogicalProcessorCount(), notNullValue());
            assertThat(metrics.getHost().getJvm().getName(), notNullValue());
            assertThat(metrics.getHost().getOs().getFamily(), notNullValue());
            assertThat(metrics.getConfigurations().getRepositoryType(), is("memory"));
            assertThat(metrics.getConfigurations().getQueueType(), is("memory"));
            assertThat(metrics.getExecutions(), notNullValue());
            // 1 per hour
            assertThat(metrics.getExecutions().getDailyExecutionsCount().size(), greaterThan(0));
            // no task runs as it's an empty instance
            assertThat(metrics.getExecutions().getDailyTaskRunsCount(), nullValue());
            assertThat(metrics.getInstanceUuid(), is(TestSettingRepository.instanceUuid));
        }
    }