Barkha Rastogi
Barkha Rastogi

Reputation: 11

InfluxDB is not showing all data for Non-GUI test | Jmeter + InfluxDB + Grafana

I am trying to monitor the live metrics of test running in Non-GUI mode of JMeter but I am facing below issue.

Issue: InfluxDB doesn't show all data during Non-GUI test, however during GUI test the application data is getting populated. Has anyone ever faced this kind of issue ?

Please let me know if anyone has any clue what is wrong here.

I have added below parameter in log4j2.xml file in JMeter to verify the issue.

<Logger name="org.apache.jmeter.visualizers.backend.influxdb" level="debug"/>

In jmeter.log, I see success message but the number of metrics written are always 1 for Non-GUI test.

DEBUG o.a.j.v.b.i.HttpMetricsSender: Success, number of metrics written: 1
2021-05-30 10:44:07,464 DEBUG o.a.j.v.b.i.HttpMetricsSender: Success, number of metrics written: 1
2021-05-30 10:44:12,462 DEBUG o.a.j.v.b.i.HttpMetricsSender: Success, number of metrics written: 1

Measurement details in InfluxDB during Non GUI Test -

select * from jmeter

name: jmeter

time    application endedT maxAT meanAT minAT startedT transaction
----    ----------- ------ ----- ------ ----- -------- -----------
1622139710856000000 Marsh       0      0     0      0     0        internal
1622139715779000000 Marsh       0      0     0      0     1        internal
1622139720779000000 Marsh       0      0     0      0     1        internal
1622139725779000000 Marsh       0      0     0      0     2        internal
1622139730780000000 Marsh       0      0     0      0     2        internal
1622139735779000000 Marsh       0      0     0      0     3        internal
1622139740780000000 Marsh       0      0     0      0     3        internal
1622139745779000000 Marsh       0      0     0      0     4        internal
1622139750779000000 Marsh       0      0     0      0     4        internal
1622139755780000000 Marsh       0      0     0      0     5        internal

Measurement details in InfluxDB during GUI Test -

select * from jmeter

name: jmeter

time                application avg  count countError endedT hit max  maxAT meanAT min  minAT pct90.0 pct95.0 pct99.0 rb sb startedT statut transaction
----                ----------- ---  ----- ---------- ------ --- ---  ----- ------ ---  ----- ------- ------- ------- -- -- -------- ------ -----------
1622139998794000000 Marsh                             0               0     0           0                                   0               internal
1622140003573000000 Marsh       1699 1     0                 2   1699              1699       1699    1699    1699    0  0           all    all
1622140003576000000 Marsh       1699 1                           1699              1699       1699    1699    1699    0  0           all    S01_Dashboard_Leader_FilterBy180Days_01_Launch
1622140003577000000 Marsh       1699 1                           1699              1699       1699    1699    1699                   ok     S01_Dashboard_Leader_FilterBy180Days_01_Launch
1622140003579000000 Marsh                             0               1     1           1                                   1               internal

Note: All the configurations are same in InfluxDB and Grafana for both the test, only the difference is execution mode in JMeter (Non-GUI and GUI).

Below are the steps for reference:

  1. Added Backend listener in JMeter script Backend Listener in JMeter

  2. Started Influxd.exe, started influx.exe and added database named "Marsh" using command "Create database Marsh"

  3. Started Grafana server and login into UI page using "http://localhost:3000/"

  4. Added influxdb datasource in Grafana datasource in Grafana datasource in Grafana

  5. Imported dashboard by providing dashboard ID - 5496 dashboard in Grafana

I am using windows 10 machine to do the setup.

InfluxDB version - version 1.8.6

Grafana version - grafana-7.5.3

JMeter version - apache-jmeter-5.3

Upvotes: 1

Views: 1543

Answers (2)

Barkha Rastogi
Barkha Rastogi

Reputation: 11

Thank you Dmitri T for your time.

I found the cause of this issue, and now I can get full real-time metrics in InfluxDB and Grafana.

Cause of Issue: I was trying to add a backend listener programmatically in a JMeter script. But the backend listener was not added to the correct position (under test plan) through the automated script. Therefore, it was sending some data(everything under this hierarchy) but not all data. However, when I opened the script in GUI mode, it showed the backend listener added under test plan which is why all the data was getting captured in GUI mode. Nevertheless, the problem was incorrect hierarchy of the backend listener in Non-GUI mode.

In JMeter GUI, the backend listener was visible under Test Plan.

enter image description here

However, the backend listener was not added under Test Plan when I saw it in xml viewer, it was added outside of Test Plan.

enter image description here

Fix: I added backend listener under test plan and it works fine now.

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168147

It shouldn't make any difference, if you're getting different results it means that either you're running different tests or your configuration in non-GUI mode differs from GUI mode.

So we cannot help without seeing:

Upvotes: 0

Related Questions