无论如何,在DynamoDB表中查看在同一天(UTC)内调配的吞吐量有多less次?
在增加预configuration吞吐量时,我总是担心在同一天之后不能减less预configuration的吞吐量 ,因为在同一天(UTC)内不能将DynamoDB表中的预置吞吐量降低4倍以上 。
监控图的精度似乎不足以查看同一天发生的所有先前的供应吞吐量变化。 例如,在此表中,预configuration的吞吐量减less了4倍,但在图表上看不到它:
显然,亚马逊并没有给出任何警告,因为我们增加了configuration的吞吐量,而不被允许减less。
作为ProvisionedThroughputDescription的一部分,在DescribeTable结果中返回减less的数目。 看起来DynamoDB控制台不显示这个,只显示“Last Decrease Time”。
如果这可以帮助任何人,我写了一个Python函数来查看每个DynamoDB表在同一天内调配的吞吐量减less了多less次:
import boto import operator MY_ACCESS_KEY_ID = 'copy your access key ID here' MY_SECRET_ACCESS_KEY = 'copy your secret access key here' def get_number_of_decreases_today(): ''' Scan all DynamoDB tables, and returns a dictionary with table name as key, NumberOfDecreasesToday as value. ''' dynamodb_conn = boto.connect_dynamodb(aws_access_key_id=MY_ACCESS_KEY_ID, aws_secret_access_key=MY_SECRET_ACCESS_KEY) table_names = dynamodb_conn.list_tables() table_number_of_decreases_today = {} for table_name in table_names: dynamodb_table_description = dynamodb_conn.describe_table(table_name) table_number_of_decreases_today[table_name] = dynamodb_table_description['Table']['ProvisionedThroughput']['NumberOfDecreasesToday'] #print('NumberOfDecreasesToday is {0} for table {1}'.format(table_number_of_decreases_today[table_name], table_name)) return table_number_of_decreases_today def main(): table_number_of_decreases_today = get_number_of_decreases_today() # Print table names and NumberOfDecreasesToday with alphabetically ordered table names for key, value in sorted(table_number_of_decreases_today.items(), key=operator.itemgetter(0)): print('{0}\t{1}'.format(key,value)) # Print table names by ascending NumberOfDecreasesToday for key, value in sorted(table_number_of_decreases_today.iteritems(), key=lambda (k,v): (v,k)): print('{0}\t{1}'.format(key, value)) if __name__ == "__main__": main() #cProfile.run('main()') # if you want to do some profiling