Example #1
0
    def test_python_save(self):
        write_count = metrics.GetWrite()
        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_count + 1)
Example #2
0
    def test_builder_save(self):
        write_count = metrics.GetWrite()
        save_builder_count = metrics.GetWriteApi(
            builder_impl._SAVE_BUILDER_LABEL, write_version="1")
        _ = self._create_save_v1_model()

        self.assertEqual(
            metrics.GetWriteApi(builder_impl._SAVE_BUILDER_LABEL,
                                write_version="1"), save_builder_count + 1)
        self.assertEqual(metrics.GetWrite(), write_count + 1)
Example #3
0
 def test_increment_write(self):
   self.assertEqual(metrics.GetWrite(), 0)
   metrics.IncrementWriteApi("foo")
   self.assertEqual(metrics.GetWriteApi("foo"), 1)
   metrics.IncrementWrite()
   self.assertEqual(metrics.GetWrite(), 1)