private Counter getRangeCounter(Range range, Counter dayCounter) throws IOException {
		final PeriodCounterFactory periodCounterFactory = new PeriodCounterFactory(dayCounter);
		final Counter counter;
		if (range.getPeriod() == null) {
			counter = periodCounterFactory.getCustomCounter(range);
		} else {
			switch (range.getPeriod()) {
			case JOUR:
				counter = periodCounterFactory.getDayCounter();
				break;
			case SEMAINE:
				counter = periodCounterFactory.getWeekCounter();
				break;
			case MOIS:
				counter = periodCounterFactory.getMonthCounter();
				break;
			case ANNEE:
				counter = periodCounterFactory.getYearCounter();
				break;
			case TOUT:
				throw new IllegalStateException(range.getPeriod().toString());
			default:
				throw new IllegalArgumentException(range.getPeriod().toString());
			}
		}
		return counter;
	}
@Test
	public void testGetRangeCounter() throws IOException {
		final Counter counter = createCounter();
		final Counter counter2 = new Counter("sql", null);
		final Collector collector = new Collector(TEST, List.of(counter, counter2));
		collector.getRangeCounter(Period.JOUR.getRange(), counter2.getName());
		collector.getRangeCounter(Period.TOUT.getRange(), counter2.getName());
		try {
			collector.getRangeCounter(Period.TOUT.getRange(), "unknown");
		} catch (final IllegalArgumentException e) {
			assertNotNull("getRangeCounter", e);
		}
	}