Get server general properties (#2117)

* add server handler

* get server general properties
This commit is contained in:
Barbara Valdez
2023-06-28 16:39:37 -07:00
committed by GitHub
parent 6b251bd24a
commit c2d53a3215
11 changed files with 259 additions and 17 deletions

View File

@@ -0,0 +1,32 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
namespace Microsoft.SqlTools.ServiceLayer.Utility
{
public static class ByteConverter
{
/// <summary>
/// Converts value in KBs to MBs
/// </summary>
/// <param name="valueInKb">value in kilo bytes</param>
/// <returns>Returns as double type</returns>
public static double ConvertKbtoMb(double valueInKb)
{
return (Math.Round(valueInKb / 1024, 2));
}
/// <summary>
/// Converts value in MBs to GBs
/// </summary>
/// <param name="valueInMb">value in mega bytes</param>
/// <returns>Returns as double type</returns>
public static double ConvertMbtoGb(double valueInMb)
{
return (Math.Round(valueInMb / 1024, 2));
}
}
}

View File

@@ -345,15 +345,5 @@ namespace Microsoft.SqlTools.ServiceLayer.Utility
return new string(nameChars);
}
private static readonly HashSet<char> illegalFilenameCharacters = new HashSet<char>(new char[] { '\\', '/', ':', '*', '?', '"', '<', '>', '|' });
/// <summary>
/// Converts value in KBs to MBs
/// </summary>
/// <param name="valueInKb">value in kilo bytes</param>
/// <returns>Returns as double type</returns>
public static double ConvertKbtoMb(double valueInKb)
{
return (Math.Round(valueInKb / 1024, 2));
}
}
}