class MetricService {

  public boolean update(Metric metric) throws Exception {
    LOG.info("Metric update {}", metric);

    try (SqlSession sqlSession = MyBatisUtil.getSqlSession()) {
      MetricMapper mapper = sqlSession.getMapper(MetricMapper.class);
      mapper.update(metric);
      sqlSession.commit();
    } catch (Exception e) {
      LOG.error(e.getMessage(), e);
      throw new Exception(e);
    }
    return true;
  }

  public  MetricService();

}