








<span> 1</span> <span>SELECT</span> <span>[</span><span>counter_name</span><span>]</span><span> , </span><span> 2</span> <span> "CPU Time:Total(ms)" , </span><span> 3</span> <span> "CPU Time:Requests" , </span><span> 4</span> <span> "Elapsed Time:Total(ms)" , </span><span> 5</span> <span> "Elapsed Time:Requests" </span><span> 6</span> <span>FROM</span> ( <span>SELECT</span> <span>[</span><span>counter_name</span><span>]</span><span> , </span><span> 7</span> <span>[</span><span>instance_name</span><span>]</span><span> , </span><span> 8</span> <span>[</span><span>cntr_value</span><span>]</span> <span> 9</span> <span>FROM</span> sys.dm_os_performance_counters <span>--</span><span>计数器视图</span> <span>10</span> <span>WHERE</span> <span>OBJECT_NAME</span> <span>LIKE</span> <span>'</span><span>%Batch Resp Statistics%</span><span>'</span> <span>11</span> ) os_pc PIVOT( <span>AVG</span>(<span>[</span><span>cntr_value</span><span>]</span>) <span>FOR</span> <span>[</span><span>instance_name</span><span>]</span> <span>IN</span><span> ( "CPU Time:Total(ms)", </span><span>12</span> <span> "CPU Time:Requests", </span><span>13</span> <span> "Elapsed Time:Total(ms)", </span><span>14</span> "Elapsed Time:Requests" ) )<span>AS</span> Pvt;
<span>1</span> <span>SELECT</span> <span>COUNT</span> (<span>*</span>) <span>FROM</span> sys.dm_os_performance_counters
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号