diff --git a/README.md b/README.md index f026c3b..3f2a087 100644 --- a/README.md +++ b/README.md @@ -336,6 +336,12 @@ A sample results file could be: "count": 14 } ], + "successes": [ + { + "status_code": 201, + "count": 28 + } + ], "records_processed": 50, "records_skipped": 0, "records_failed": 22 diff --git a/lightbeam/send.py b/lightbeam/send.py index 7577c4c..59e4c2f 100644 --- a/lightbeam/send.py +++ b/lightbeam/send.py @@ -163,6 +163,13 @@ async def do_send(self, endpoint): hashlog.save(hashlog_file, self.hashlog_data) # update metadata counts for this endpoint + statuses = self.lightbeam.status_counts.keys() + successes = [] + for status in statuses: + if status>=200 and status<300: + successes.append({"status_code": status, "count": self.lightbeam.status_counts[status]}) + if len(successes)>0: + self.metadata["resources"][endpoint].update({"successes": successes}) self.metadata["resources"][endpoint].update({ "records_processed": total_counter, "records_skipped": self.lightbeam.num_skipped,