Azure-Samples / Iot-Telemetry-Simulator

The IoT Telemetry Simulator allows you to test Azure IoT Hub or Eventhub ingestion at scale. The implementation is communicating with Azure IoT Hub using multiplexed AMQP connections. An automation library allows you to run it as load test as part of a CI/CD pipeline.
MIT License
68 stars 48 forks source link

does 'Interval' parameter works? #41

Closed xiongyu0523 closed 2 years ago

xiongyu0523 commented 2 years ago

Please provide us with the following information:

This issue is for Interval parameter: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

docker run -it -e "IotHubConnectionString=HostName=your-iothub-name.azure-devices.net;SharedAccessKeyName=device;SharedAccessKey=your-iothub-key" mcr.microsoft.com/oss/azure-samples/azureiot-telemetrysimulator -e Interval=30000 -e DeviceList="mydevice"

Any log messages given by the failure

No errors but printing message shows Interval = System.Int32[]ms and the message is sending at 1000ms rate.

Expected/desired behavior

message sending at 30s interval.

OS and Version?

Windows 11, Docker Desktop

Versions

Latest

Mention any other details that might be useful


Thanks! We'll be in touch soon.

gukoff commented 2 years ago

Could you please try if either of these works?

docker run -it -e "IotHubConnectionString=HostName=your-iothub-name.azure-devices.net;SharedAccessKeyName=device;SharedAccessKey=your-iothub-key" mcr.microsoft.com/oss/azure-samples/azureiot-telemetrysimulator -e WaitIntervals=30000 -e DeviceList="mydevice"

docker run -it -e "IotHubConnectionString=HostName=your-iothub-name.azure-devices.net;SharedAccessKeyName=device;SharedAccessKey=your-iothub-key" mcr.microsoft.com/oss/azure-samples/azureiot-telemetrysimulator -e WaitIntervals=[30000] -e DeviceList="mydevice"

xiongyu0523 commented 2 years ago

@gukoff when I try to use WaitIntervals (either), I get the below error prompt

warn: IotTelemetrySimulator.SimulationWorker[0]
      No custom telemetry variables found
warn: IotTelemetrySimulator.SimulationWorker[0]
      Using default telemetry template
Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at IotTelemetrySimulator.RunnerConfiguration.EnsureIsValid() in /src/src/IotTelemetrySimulator/RunnerConfiguration.cs:line 89
   at IotTelemetrySimulator.SimulationWorker..ctor(IDeviceSimulatorFactory deviceSimulatorFactory, IHostApplicationLifetime applicationLifetime, IConfiguration configuration, ILogger`1 logger) in /src/src/IotTelemetrySimulator/SimulationWorker.cs:line 34
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at IotTelemetrySimulator.Program.Main(String[] args) in /src/src/IotTelemetrySimulator/Program.cs:line 12
xiongyu0523 commented 2 years ago

@gukoff any ideas?

gukoff commented 2 years ago

@fbeltrao @LauraDamianTNA

barustum commented 2 years ago

Same issue here.

yashkmochi007 commented 2 years ago

Any update on this issue? Is there any workaround?

fbeltrao commented 2 years ago

@barustum, @yashkmochi007 thanks for reporting the issue. I will take a look.

yashkmochi007 commented 2 years ago

Thanks @fbeltrao for responding and fixing quickly it. Hope that, PR will be merged soon and deployed on docker container registry.