diff options
| author | Brian Elliott <bdelliott@gmail.com> | 2013-05-17 17:46:30 +0000 |
|---|---|---|
| committer | Brian Elliott <bdelliott@gmail.com> | 2013-05-17 19:53:25 +0000 |
| commit | e788bc24809693b19969c7f7fb44f414bb3b890a (patch) | |
| tree | b57a1669a1211b41c2edbba83300871572766aa3 /nova/db | |
| parent | 0e760b3e94c53e8f794609a60343b392e7ff595c (diff) | |
Don't update DB records for unchanged stats.
Change-Id: I6eb0adba12676cf057c92fb0b54431cfe6a76210
Diffstat (limited to 'nova/db')
| -rw-r--r-- | nova/db/sqlalchemy/api.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 95cbb6efa..9caf096cd 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -519,9 +519,10 @@ def _update_stats(context, new_stats, compute_id, session, prune_stats=False): for k, v in new_stats.iteritems(): old_stat = statmap.pop(k, None) if old_stat: - # update existing value: - old_stat.update({'value': v}) - stats.append(old_stat) + if old_stat['value'] != unicode(v): + # update existing value: + old_stat.update({'value': v}) + stats.append(old_stat) else: # add new stat: stat = models.ComputeNodeStat() |
