In general, OpenGL does not count the draw calls. You would have to manage a uniform counter yourself or you can generate an SSBO for each mesh and bind the SSBO belonging to the mesh before the draw call.
A possibility I can see is using Multi-Draw (see glMultiDrawArrays ). But then you have to store the data for all the meshes in the same buffer objects and the vertex attribute specification has to be the same for all meshes, stored in one Vertex Array Object.
The index of the drawing command is stored in the built-in vertex shader input variable gl_DrawID (Requires GLSL 4.60 or ARB_shader_draw_parameters).
Another way to improve performance is to sort the meshs so that fewer changes to the uniforms are required. If there are mehes that have the same uniform settings, then render them in succession, without setting the uniforms in between.
The best performance improvement can be achieved by not rendering. Do not render all meshes, render only the geometry that is "visible" in the viewport.
You can implement some simple culling test like View Frustum Culling. Skip a mesh if the bounding box or the bounding sphere of the mesh is not in place and does not intersect the Viewing frustum.