Azure的表的存储 - 多少数据我使用的? [英] Azure Table Storage - How much data am I using?

查看:258
本文介绍了Azure的表的存储 - 多少数据我使用的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道我可以找出我多少数据在每个表中存储内的每个我的存储帐户?

Anyone know how i can identify how much data I'm storing in each table within each of my storage accounts?

我知道我可以用于我的所有存储帐户的总体数据,但我试图找出每个表有多少使用。

I know i can get the overall data used for all my storage accounts but I'm trying to figure how much each table is using.

我不;吨认为天青提供任何现成的,但我将如何去创造一些摸不着头脑

I don;t think Azure offers anything out of the box but how would I go about creating something to figure this out?

推荐答案

有两种方式,通过它可以在您的存储账户提取所有表的大小。

There are two ways by which you can fetch the size of all tables in your storage account.

选项1:费时路

请参阅本优秀的博客文章由Avkash肖汉如何实体的大小计算方法是:<一href=\"http://blogs.msdn.com/b/avkashchauhan/archive/2011/11/30/how-the-size-of-an-entity-is-caclulated-in-windows-azure-table-storage.aspx\" rel=\"nofollow\">http://blogs.msdn.com/b/avkashchauhan/archive/2011/11/30/how-the-size-of-an-entity-is-caclulated-in-windows-azure-table-storage.aspx.本质上,公式是:

Please refer to this excellent blog post by Avkash Chauhan on how the size of an entity is calculated: http://blogs.msdn.com/b/avkashchauhan/archive/2011/11/30/how-the-size-of-an-entity-is-caclulated-in-windows-azure-table-storage.aspx. Essentially the formula is:

4个字节+ LEN(PartitionKey + RowKey)* 2个字节+换每个属性(8
  字节+ LEN(属性名称)* 2个字节+的sizeof(.NET物业类型))

4 bytes + Len (PartitionKey + RowKey) * 2 bytes + For-Each Property(8 bytes + Len(Property Name) * 2 bytes + Sizeof(.Net Property Type))

什么你可能做的是从所有的表获取实体。如你取实体,则计算每个实体和所有实体的尺寸的总和的大小是表存储器的大小(加上一些尺寸,用于存储表的名称)。

What you could possibly do is fetch entities from all the tables. As you fetch entities, you compute the size of each entity and the sum of size of all entities is the size of table storage (plus some size for storing table names).

请注意,这取决于您的存储账户表和数据在那里的数量,它可能需要一段时间。此外,你会招致存储的交易成本和出站带宽成本,如果你运行的Azure之外的这个应用程序。

Please note that depending on the number of tables in your storage account and the data in there, it could take a while. Moreover, you would incur storage transaction costs and outbound bandwidth costs if you run this application from outside of Azure.

选项2:简单的方法

这是我们使用在我们的应用中,我们显示存储账户(斑点,文件,队列和表)的总大小的东西。从本质上讲,我们使用 Azure的计费/使用API​​ 的。使用此API,可以获取存储帐户的大小。当你从这个API获取数据,数据以JSON格式返回。对于存储账户规模,请注意,这个数据是累积的,即由API重presents在记录指定的日期/时间值的存储帐户的大小返回的值。

This is something we're using in our application where we display the total size of a storage account (blobs, files, queues, and tables). Essentially, we make use of Azure Billing/Usage API. Using this API, you can fetch the storage account size. When you fetch the data from this API, the data is returned in JSON format. For storage account size, please note that this data is cumulative i.e. the value returned by the API represents the size of a storage account on the date/time value indicated in the record.

每个记录包含了一些事情。什么是在这种情况下,有趣的对你来说是仪表种类(这是存储),仪表子目录(这将取决于您的存储账户的类型)和表名称。您感兴趣的仪表名为标准IO - 表/队列(GB)。至于获取的计费数据而言,你可以用每天或每小时粒度取数据。如果你的读取与日常粒度数据,只要乘以您获得价值 31 来获得GB总规模。每小时粒度,乘你 744 去获得总大小的值。有一个关于如何使用计费/使用API​​提供的示例应用程序在Github上,你可以在这里找到:的https: //github.com/Azure/Billing$c$cSamples

Each record contains a number of things. What's interesting for you in this case is Meter Category (which would be Storage), Meter Subcategory (which would depend on the type of your storage account) and Meter Name. The meter name that you're interested in is Standard IO - Table/ Queue (GB). As far as fetching the billing data is concerned, you can fetch that data with either daily or hourly granularity. If you're fetching the data with daily granularity, just multiply the value you get with 31 to get the total size in GB. For hourly granularity, multiply the value you get with 744 to get the total size. There's a sample application available on Github on how to use Billing/Usage API which you can find here: https://github.com/Azure/BillingCodeSamples.

如果你想看到这个动作,随意尝试,我构建的应用程序。您可以了解更多有关这个特殊的功能在我们的博客文章的http://blog.cloudportam.com/cloud-portam-updates-detailed-storage-account-usage-reports.

If you want to see this in action, feel free to try out the application I'm building. You can learn more about this specific functionality on our blog post at http://blog.cloudportam.com/cloud-portam-updates-detailed-storage-account-usage-reports.

这篇关于Azure的表的存储 - 多少数据我使用的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆