title: Programmatically get Google Datastore record count and used storage
body: <p>I need to get Google Datastore usage statistics - storage usage, and record count for my application.</p>
  
  <p>At the moment I only can count fetch all items and count them. But I have no idea how I can get storage amount used. </p>
  
  <p>Is there any reports API I can use? (Like Google Apps report api)</p>
  
  <p>PS. I use <a href="https://github.com/GoogleCloudPlatform/gcloud-python" rel="nofollow">gcloud-python</a> library to access Datastore.</p>
  
  <p>Edited:</p>
  
  <p>Thank you Andrei - Angels Like Reb</p>
  
  <p>That's how I did it:</p>
  
  <pre><code>from gcloud import datastore
  stat = list(datastore.Query('__Stat_Total__').fetch())[0]
  print "bytes", stat['bytes']
  print "count", stat['count']
  </code></pre>