Skip to content

Commit

Permalink
Add some debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Jan 27, 2020
1 parent ddd675c commit 01288e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2019 Red Hat Inc and others.
* Copyright (c) 2017, 2020 Red Hat Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -16,6 +16,9 @@

import java.util.Optional;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.dentrassi.hono.demo.common.AppRuntime;
import de.dentrassi.hono.demo.common.DeadlockDetector;
import de.dentrassi.hono.demo.common.Payload;
Expand All @@ -38,6 +41,8 @@

public class Application {

private static final Logger logger = LoggerFactory.getLogger(Application.class);

private static final ProducerConfig config = ProducerConfig.fromEnv();

private static final String METHOD = Environment.get("HTTP_METHOD").orElse("PUT");
Expand Down Expand Up @@ -97,6 +102,8 @@ private static void runSimulator(final AppRuntime runtime) throws InterruptedExc
final String username = String.format("user-%s-%s", deviceIdPrefix, i);
final String deviceId = String.format("%s-%s", deviceIdPrefix, i);

logger.debug("Starting device - deviceId: {}, authId: {}", deviceId, username);

final var request = createRequest(webClient, config, Payload.payload(), Tenant.TENANT, deviceId,
username, PASSWORD);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ protected void handleSuccess(final Instant start) {
}

protected void handleException(final Throwable e) {
logger.debug("Failed to tick device", e);
this.statistics.failed();
this.statistics.error(0);
}
Expand Down

0 comments on commit 01288e7

Please sign in to comment.