#
# Copyright (c) 2019, Red Hat.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# 
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
#
# Microsoft SQL server derived metrics
# These derived metrics complete calculation of those metrics requiring
# client-side computation using multiple base metrics from SQL Server.
#

mssql.buffer_manager.buffer_cache_hit_ratio = 100 * (mssql.buffer_manager.raw_buffer_cache_hit_ratio / mssql.buffer_manager.raw_buffer_cache_hit_ratio_base)

mssql.databases.log_cache_hit_ratio = 100 * (mssql.databases.raw_log_cache_hit_ratio / mssql.databases.raw_log_cache_hit_ratio_base)

mssql.latches.average_latch_wait_time = (mssql.latches.raw_average_latch_wait_time / mssql.latches.raw_average_latch_wait_time_base)

mssql.locks.average_wait_time = (mssql.locks.raw_average_wait_time / mssql.locks.raw_average_wait_time_base)

mssql.plan_cache.cache_hit_ratio = (mssql.plan_cache.raw_cache_hit_ratio / mssql.plan_cache.raw_cache_hit_ratio_base)
