Is it possible in Windows using standard performance counters to determine the query execution time in the MySql database, i.e. waiting time between calling IDbCommand.ExecuteReader and getting data?

  • Is it better to take measurements directly in mysql ? Otherwise, you risk testing the speed of your internet - BOPOH
  • In the end, you need to show the ratio of the running time of the program as a whole and the expectation of a response from the database. In general, to see that the time spent on working out the algorithms of the program is significantly less than the time it takes to process queries in the database. - mals

1 answer 1

The standard connector supports only two counters - HardProcedureQueries and HardProcedureQueries , in the category .NET Data Provider for MySQL .

The counters are enabled with the option Use Performance Monitor=true in the connection string (or its attributes - UsePerformanceMonitor , userperfmon , perfmon ).

But both standard counters are of the NumberOfItems type, so the execution time based on them cannot be obtained. Maximum - the number of requests per second for a certain period of time.