How to query the total number of Loki

The data is stored in loki, my Java program, using the http interface to query. How do I query the total number of stored data.