def test_python_save(self): write_count = metrics.GetWrite(write_version="2") save_api_count = metrics.GetWriteApi(save._SAVE_V2_LABEL) _ = self._create_save_v2_model() self.assertEqual(metrics.GetWriteApi(save._SAVE_V2_LABEL), save_api_count + 1) self.assertEqual(metrics.GetWrite(write_version="2"), write_count + 1)
def test_builder_save(self): write_count = metrics.GetWrite(write_version="1") save_builder_count = metrics.GetWriteApi( builder_impl._SAVE_BUILDER_LABEL) _ = self._create_save_v1_model() self.assertEqual(metrics.GetWriteApi(builder_impl._SAVE_BUILDER_LABEL), save_builder_count + 1) self.assertEqual(metrics.GetWrite(write_version="1"), write_count + 1)
def test_SM_increment_write(self): self.assertEqual(metrics.GetWrite(write_version="1"), 0) metrics.IncrementWriteApi("foo") self.assertEqual(metrics.GetWriteApi("foo"), 1) metrics.IncrementWrite(write_version="1") self.assertEqual(metrics.GetWrite(write_version="1"), 1)