16 #ifndef TENSORFLOW_SERVING_RESOURCES_RESOURCE_TRACKER_H_
17 #define TENSORFLOW_SERVING_RESOURCES_RESOURCE_TRACKER_H_
22 #include "tensorflow_serving/core/loader.h"
23 #include "tensorflow_serving/resources/resource_util.h"
25 namespace tensorflow {
35 static Status Create(
const ResourceAllocation& total_resources,
36 std::unique_ptr<ResourceUtil> util,
37 std::unique_ptr<ResourceTracker>* tracker);
46 Status ReserveResources(
const Loader& servable,
bool* success);
55 Status RecomputeUsedResources(
const std::vector<const Loader*>& servables);
57 const ResourceAllocation& total_resources()
const {
return total_resources_; }
58 const ResourceAllocation& used_resources()
const {
return used_resources_; }
62 std::unique_ptr<ResourceUtil> util);
65 const std::unique_ptr<ResourceUtil> util_;
68 const ResourceAllocation total_resources_;
75 ResourceAllocation used_resources_;