<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Performance SLA Calculation using AppDynamics REST API | Individual Business Transaction | PowerShell in Splunk AppDynamics</title>
    <link>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736935#M10148</link>
    <description>&lt;P&gt;hello Sahil,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;first of all thanks for the code.&lt;/P&gt;&lt;P&gt;I got some errors when I wanted to use it. I wanted to change the url here. I wrote application id instead of "SUM-Calls-PER-MIN-ENDPOINT", but I still couldn't run it.&lt;/P&gt;&lt;P&gt;Also, how can I see the response results for a single url?&lt;/P&gt;&lt;P&gt;When I say $response it is empty.&lt;/P&gt;&lt;P&gt;I request your help.&lt;/P&gt;&lt;P&gt;$controllerEndpoint = "controller/rest/applications/SUM-Calls-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=$StartDateEpoch&amp;amp;end-time=$EndDateEpoch"&lt;BR /&gt;PS D:\Users\halerol&amp;gt; $restURL = "${protocol}://${controller}:${port}/${controllerEndpoint}"&lt;BR /&gt;PS D:\Users\halerol&amp;gt; $restURL&lt;BR /&gt;&lt;A href="https://appd:443/controller/rest/applications/SUM-Calls-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=&amp;amp;end-time=" target="_blank" rel="noopener nofollow noreferrer"&gt;https://appd:443/controller/rest/applications/SUM-Calls-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=&amp;amp;end-time=&lt;/A&gt;&lt;BR /&gt;PS D:\Users\xxx&amp;gt; $headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}&lt;/P&gt;&lt;P&gt;PS D:\Users\xxx&amp;gt; $headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}&lt;BR /&gt;PS D:\Users\xxx&amp;gt; $response = Invoke-WebRequest -Uri $restURL -Headers $headers&lt;BR /&gt;Invoke-WebRequest : HTTP Status 400 - Invalid application id sum-calls-per-min-endpoint is specified&lt;BR /&gt;type Status report&lt;BR /&gt;messageInvalid application id sum-calls-per-min-endpoint is specified&lt;BR /&gt;descriptionThe request sent by the client was syntactically incorrect.&lt;BR /&gt;At line:1 char:13&lt;BR /&gt;+ $response = Invoke-WebRequest -Uri $restURL -Headers $headers&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 12:15:11 GMT</pubDate>
    <dc:creator>Haluk_Yaşar_Ero</dc:creator>
    <dc:date>2022-04-19T12:15:11Z</dc:date>
    <item>
      <title>Performance SLA Calculation using AppDynamics REST API | Individual Business Transaction | PowerShell</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736934#M10147</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I have created a PowerShell&amp;nbsp;Tool to generate Daily Performance SLA Calculation for Individual Business Transactions using AppDynamics REST API. I tried my best to add explanation of each code line.&lt;/P&gt;&lt;P&gt;Hope it is helpful!&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.JPG" style="width: 796px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.jpeg"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/35326iE148284DBEF0B281/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.jpeg" alt="image.jpeg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample language-python"&gt;&lt;CODE&gt;##It is PowerShell Code, marked it as Python to keep the indent as is##

#Prerequisites: # 0) Make Sure you have basic understanding of PoswerShell and AppD REST API - It is no rocket science
                # 1) PowerShell, MicroSoft Excel (I tested it with Excel 2013)

#Instructions: # 0) This tool automatically takes care of EPOCH time calculations. Calcumations are done in 
             # 1) Make sure user name is followed by '@customer1' or relevent customer ID
             # 2) It uses H:\ as default drive to save output excel, you can change it if required
             # 3) This reprot is created to support 4 Business Transactiosn, using same user ID for authantication
             # 4) Instructions to modify users is mentioned in script
             # 5) If you need to add / remove BTs, please understand this script and do it manually
             # 6) #This report works in UTC - Coordinated Universal Tim
             # 7) Formula Used: Percentage Successful transactions = ((Sum of Call - Sum of Errors )/ Sum of Calls) *100

#Clear Variable Cache (Without popping up erros on PowerShell Screen) - Start 
Remove-Variable * -ErrorAction:Ignore
#Clear Variable Cache - Completed

 
#Custom Message (Optional) - Start

[System.Windows.MessageBox]::Show('                                 Welcome to AppDynamics Performance Reporting!! 

Program:     Your Program Name
#This tool was created with a pre-defined set of Business transactions. You are NOT allowed to choose Business Transactions on the go.
#It will save all results in Excel.
#This report works only in UTC - Coordinated Universal Time.

                                     Author: Sahil Gupta - SahiljGupta@gmail.com')

#Custom Message - Completed

#Check today's date - Start
$TodayDate = $(Get-Date)
#Check today's date - Completed

#Capture Start date (SD) - Date FROM which user needs report - Start

Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$form = New-Object Windows.Forms.Form -Property @{
    StartPosition = [Windows.Forms.FormStartPosition]::CenterScreen
    Size          = New-Object Drawing.Size 243, 230
    Text          = 'Start Date'
    Topmost       = $true
}
$calendar = New-Object Windows.Forms.MonthCalendar -Property @{
    ShowTodayCircle   = $false
    MaxSelectionCount = 1
    MaxDate = $TodayDate

#Max date is Today, so user cannot select future date - Comment

}
$form.Controls.Add($calendar)

$okButton = New-Object Windows.Forms.Button -Property @{
    Location     = New-Object Drawing.Point 38, 165
    Size         = New-Object Drawing.Size 75, 23
    Text         = 'OK'
    DialogResult = [Windows.Forms.DialogResult]::OK
}
$form.AcceptButton = $okButton
$form.Controls.Add($okButton)

$cancelButton = New-Object Windows.Forms.Button -Property @{
    Location     = New-Object Drawing.Point 113, 165
    Size         = New-Object Drawing.Size 75, 23
    Text         = 'Cancel'
    DialogResult = [Windows.Forms.DialogResult]::Cancel
}
$form.CancelButton = $cancelButton
$form.Controls.Add($cancelButton)

$result = $form.ShowDialog()

if ($result -eq [Windows.Forms.DialogResult]::OK) {
    $date = $calendar.SelectionStart
    Write-Host "Date selected: $($date.ToShortDateString())"
}
else {Break}


#Break if user select Cancel - Comment

$sd = $date

#Capture Start date (SD) - Date FROM which user needs report - Completed

#Capture End date (ED) - Date TILL which user needs report - started

Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$form = New-Object Windows.Forms.Form -Property @{
    StartPosition = [Windows.Forms.FormStartPosition]::CenterScreen
    Size          = New-Object Drawing.Size 243, 230
    Text          = 'End Date'
    Topmost       = $true
}
$calendar = New-Object Windows.Forms.MonthCalendar -Property @{
    ShowTodayCircle   = $false
    MaxSelectionCount = 1
    MinDate = $sd
    MaxDate = $TodayDate

#Min Date is equal to start date, So user cannot select end date lesser than start date - Comment
#Max date is Today, so user cannot select future date - Comment
}
$form.Controls.Add($calendar)

$okButton = New-Object Windows.Forms.Button -Property @{
    Location     = New-Object Drawing.Point 38, 165
    Size         = New-Object Drawing.Size 75, 23
    Text         = 'OK'
    DialogResult = [Windows.Forms.DialogResult]::OK
}
$form.AcceptButton = $okButton
$form.Controls.Add($okButton)

$cancelButton = New-Object Windows.Forms.Button -Property @{
    Location     = New-Object Drawing.Point 113, 165
    Size         = New-Object Drawing.Size 75, 23
    Text         = 'Cancel'
    DialogResult = [Windows.Forms.DialogResult]::Cancel
}
$form.CancelButton = $cancelButton
$form.Controls.Add($cancelButton)

$result = $form.ShowDialog()

if ($result -eq [Windows.Forms.DialogResult]::OK) {
    $date1 = $calendar.SelectionStart
    Write-Host "Date selected: $($date1.ToShortDateString())"
}
else {Break}

#Break if user select Cancel - Comment
$ed = $date1 


Start-Sleep -s 0

#Capture End date (ED) - Date TILL which user needs report - Completed

#Capture Credential  - Started
#Make sure user name is followed by '@customer1'
$Credentials = Get-Credential -Credential $null
$user = $Credentials.UserName
$Credentials.Password | ConvertFrom-SecureString
$password = $Credentials.GetNetworkCredential().password
#Capture Credential  - Completed



#Generate excel - file NAME - started
#You can change the name of Excel as required here
$ExcelName = ("AppDynamicsSLAreport_Created_" + $($TodayDate.ToShortDateString()) +"_"  + (Get-Date -format HHmm) + "_StartDate_" + $($sd.ToShortDateString())  + "_EndDate_"+  $($ed.ToShortDateString())  + ".xlsx")
#Generate excel - file NAME - completed

#calculate no of days - no of times transaction to be run - diff between dates + 1

#Time Span - No of times this iteration will run is $ts - Start
$ts1 = New-TimeSpan -Start $sd -End $ed
$ts = 1 + $ts1.Days # Check results
#Time Span - No of times this iteration will run is $ts - Completed

Start-Sleep -s 0

#EPOCH Time Calculation -  AppD REST APIs works in Epoch Time - Comment
$EpochDate = '1970-01-01'
#Base Epoch Date - Comment

## Extra commands for future expansion
# $ts = New-TimeSpan -Start $EpochDate -End $sd
# $ts.TotalSeconds
#$EndDateEpoch = (New-TimeSpan -Start $EpochDate -End $sd).TotalSeconds


#Remove old TEMP Excel files - started
write-host ("Below listed files will be deleted now from H Drive")
write-host(Get-ChildItem H:\ | Where-Object Name -Like SahilTempExcelAppDReport.xlsx)
Remove-Item h:\SahilTempExcelAppDReport.xlsx -ErrorAction:Ignore
#Remove old Excel files - completed


Start-Sleep -s 0

#EXCEL Editing - Started
$excel = New-Object -ComObject excel.application
$excel.visible = $true
$workbook = $excel.Workbooks.Add()
$SGSpace= $workbook.Worksheets.Item(1)
$SGSpace.Name = "SahilAppDReport"


#Check and update the cell number FOR Application Name in excel sheet - started

$SGSpace.Cells.Item(1,1)= "AppDynamics Performance Report"
$SGSpace.Cells.Item(1,1).Interior.ColorIndex = 15
$SGSpace.Cells.Item(1,1).Font.Bold = $True



$SGSpace.Cells.Item(2,1)= "Business Transaction 1"
$SGSpace.Cells.Item(2,1).Interior.ColorIndex = 15
$SGSpace.Cells.Item(2,1).Font.Bold = $True


$SGSpace.Cells.Item(3,1)= "Business Transaction 2"
$SGSpace.Cells.Item(3,1).Interior.ColorIndex = 15
$SGSpace.Cells.Item(3,1).Font.Bold = $True



$SGSpace.Cells.Item(4,1)= "Business Transaction 3"
$SGSpace.Cells.Item(4,1).Interior.ColorIndex = 15
$SGSpace.Cells.Item(4,1).Font.Bold = $True


$SGSpace.Cells.Item(5,1)= "Business Transaction 4"
$SGSpace.Cells.Item(5,1).Interior.ColorIndex = 15
$SGSpace.Cells.Item(5,1).Font.Bold = $True



#Check and update the cell number FOR DATE in excel sheet - Completed

Start-Sleep -s 0

###################################################################

#Enough, calling REST API - FOR "Business Transaction 1" - Started


for (($i =0); $i -lt $ts; $i++)
{

$StartDateEpoch = (New-TimeSpan -Start $EpochDate -End $sd).TotalMilliseconds  + (86400000*$i)
# Day wise calculation of start time - Epoch format - comment
$EndDateEpoch = $StartDateEpoch + 86400000
# Day wise calculation of end time - Epoch format - comment



#Call rest API for 'Sum of Calls' - started
#Modify as per your environment - comment
$controller = "controller.domain.com"
$port = "443/8080"
$protocol = "https/http"

#In case you want to use dedicated user, please use below code - started
#Do not forget to modify header as stated below
    #$account = "customer1"
    #$user = "AppD_username"
    #$password = "AppD123"
#In case you want to use dedicated user, please use below code - completed

#Modify as per your environment - comment
$controllerEndpoint = "controller/rest/applications/ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=$StartDateEpoch&amp;amp;end-time=$EndDateEpoch"
$restURL = "${protocol}://${controller}:${port}/${controllerEndpoint}"
$restURL
$headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}

#In case you want to use dedicated user, modify header as - started
    #$headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}@${account}:${password}"))}
#In case you want to use dedicated user, modify header as - completed

$response = Invoke-WebRequest -Uri $restURL -Headers $headers
$response.content
#Call rest API for 'Sum of Calls' - Completed
#Capture 'Sum of Calls' from API response - started
$response -match "&amp;lt;sum&amp;gt;(?&amp;lt;content&amp;gt;.*)&amp;lt;/sum&amp;gt;"
$SumofCalls = $matches['content']
#Capture 'Sum of Calls' from API response - Completed

#if 'Sum of Calls' is 0 or NonInteger, exit script. else powershell will try to divde by 0 - Start
If ($SumofCalls -gt  0) {

#Call rest API for 'Sum of Errors' - started
$controllerEndpoint = "controller/rest/applications/SUM-Calls-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=$StartDateEpoch&amp;amp;end-time=$EndDateEpoch"
$restURL = "${protocol}://${controller}:${port}/${controllerEndpoint}"
$restURL
$headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}
$response = Invoke-WebRequest -Uri $restURL -Headers $headers
$response.content
#Call rest API for 'Sum of Errors' - Completed
#Capture 'Sum of Errors' from API response - started
$response -match "&amp;lt;sum&amp;gt;(?&amp;lt;content1&amp;gt;.*)&amp;lt;/sum&amp;gt;"
$SumofErrors1 = $matches['content1']
#Capture 'Sum of Errors' from API response - Completed

#Avoid 0 or NonInteger SumofErrors - Started

If ($SumofErrors1 -gt  0) { 
$SumofErrors = $SumofErrors1}
else {
$SumofErrors = 0
}

#Avoid 0 or NonInteger SumofErrors - Completed

#Calculate percentage successfull transaction - started
$PercentSuccessfulTransactions = [math]::Round(((($SumofCalls - $SumofErrors)*100)/$SumofCalls),2)

#Calculate percentage successfull transaction - Completed

#Check background color of metric in excel - started
#You can specify Accepted/agreed SLA here
#I used 99.5 and above as Green (ColorIndex 50), anything below that will be RED (color Indey 3) - comment
if ($PercentSuccessfulTransactions  -lt  99.5) { 
$ColorIndex = 3
} else {$ColorIndex = 50}
#Check background color of metric in excel - Completed

} else 
#NonZero PercentSuccessfulTransactions, Else statement - started
#If Sum of call returns 0, it will be marked as NA
{
$PercentSuccessfulTransactions = "NA"
$ColorIndex = 16
}
#NonZero PercentSuccessfulTransactions, Else statement - started


Write-Host ("Itration Number" + $i)
Write-Host ("start date of itration $i - " + $StartDateEpoch)
Write-Host ("End date of itration $i - " + $EndDateEpoch)
Write-Host ("Sum of Calls of itration $i - " + $SumofCalls)
Start-Sleep -s 0

Write-Host ("Sum of Errors of itration  of itration $i - " + $SumofErrors)
Write-Host ("Percent Successful Transactions $i - " + $PercentSuccessfulTransactions)
Write-Host ("Color Index of itration $i - " + $ColorIndex)

#Check and update the cell number FOR DATE in excel sheet - started
$CellNumberRow1 = $i +2
$SGSpace.Cells.Item(1,$CellNumberRow1)= (($sd.AddDays(($i))).ToShortDateString())
$SGSpace.Cells.Item(1,$CellNumberRow1).Interior.ColorIndex = 15
$SGSpace.Cells.Item(1,$CellNumberRow1).Font.Bold = $True

#Check and update the cell number FOR DATE in excel sheet - Completed




#Check and update the cell number in excel sheet - started
$CellNumber = $i +2
$SGSpace.Cells.Item(2,$CellNumber)= $PercentSuccessfulTransactions
$SGSpace.Cells.Item(2,$CellNumber).Interior.ColorIndex = $ColorIndex
$SGSpace.Cells.Item(2,$CellNumber).Font.Color = 16777215

#Check and update the cell number in excel sheet - Completed

Start-Sleep -s 0

}

#Enough, calling REST API - FOR "Business Transaction 1" - Completed


###################################################################

###################################################################

#Enough, calling REST API - FOR "Business Transaction 2" - Started


for (($i =0); $i -lt $ts; $i++)
{

$StartDateEpoch = (New-TimeSpan -Start $EpochDate -End $sd).TotalMilliseconds  + (86400000*$i)
# Day wise calculation of start time - Epoch format - comment
$EndDateEpoch = $StartDateEpoch + 86400000
# Day wise calculation of end time - Epoch format - comment



#Call rest API for 'Sum of Calls' - started
$controller = "controller.domain.com"
$port = "443/8080"
$protocol = "https/http"



$controllerEndpoint = "controller/rest/applications/SUM-Calls-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=$StartDateEpoch&amp;amp;end-time=$EndDateEpoch"
$restURL = "${protocol}://${controller}:${port}/${controllerEndpoint}"
$restURL
$headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}
$response = Invoke-WebRequest -Uri $restURL -Headers $headers
$response.content
#Call rest API for 'Sum of Calls' - Completed
#Capture 'Sum of Calls' from API response - started
$response -match "&amp;lt;sum&amp;gt;(?&amp;lt;content&amp;gt;.*)&amp;lt;/sum&amp;gt;"
$SumofCalls = $matches['content']
#Capture 'Sum of Calls' from API response - Completed

#if 'Sum of Calls' is 0 or NonInteger, exit script. else powershell will try to divde by 0 - Start
If ($SumofCalls -gt  0) {

#Call rest API for 'Sum of Errors' - started
$controllerEndpoint = "controller/rest/applications/SUM-ERROR-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=$StartDateEpoch&amp;amp;end-time=$EndDateEpoch"
$restURL = "${protocol}://${controller}:${port}/${controllerEndpoint}"
$restURL
$headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}
$response = Invoke-WebRequest -Uri $restURL -Headers $headers
$response.content
#Call rest API for 'Sum of Errors' - Completed
#Capture 'Sum of Errors' from API response - started
$response -match "&amp;lt;sum&amp;gt;(?&amp;lt;content1&amp;gt;.*)&amp;lt;/sum&amp;gt;"
$SumofErrors1 = $matches['content1']
#Capture 'Sum of Errors' from API response - Completed

#Avoid 0 or NonInteger SumofErrors - Started

If ($SumofErrors1 -gt  0) { 
$SumofErrors = $SumofErrors1}
else {
$SumofErrors = 0
}

#Avoid 0 or NonInteger SumofErrors - Completed

#Calculate percentage successfull transaction - started
$PercentSuccessfulTransactions = [math]::Round(((($SumofCalls - $SumofErrors)*100)/$SumofCalls),2)

#Calculate percentage successfull transaction - Completed

#Check background color of metric in excel - started
if ($PercentSuccessfulTransactions  -lt  99.5) { 
$ColorIndex = 3
} else {$ColorIndex = 50}
#Check background color of metric in excel - Completed

} else 
#NonZero PercentSuccessfulTransactions, Else statement - started
{
$PercentSuccessfulTransactions = "NA"
$ColorIndex = 16
}
#NonZero PercentSuccessfulTransactions, Else statement - started


Write-Host ("Itration Number" + $i)
Write-Host ("start date of itration $i - " + $StartDateEpoch)
Write-Host ("End date of itration $i - " + $EndDateEpoch)
Write-Host ("Sum of Calls of itration $i - " + $SumofCalls)
Start-Sleep -s 0

Write-Host ("Sum of Errors of itration $i - " + $SumofErrors)
Write-Host ("Percent Successful Transactions $i - " + $PercentSuccessfulTransactions)
Write-Host ("Color Index of itration $i - " + $ColorIndex)

#Check and update the cell number FOR DATE in excel sheet - started (One Time activity - Already done for 1st BT)
##$CellNumberRow1 = $i +2
##$SGSpace.Cells.Item(1,$CellNumberRow1)= (($sd.AddDays(($i))).ToShortDateString())
##$SGSpace.Cells.Item(1,$CellNumberRow1).Interior.ColorIndex = 24
##$SGSpace.Cells.Item(1,$CellNumberRow1).Font.Bold = $True
#Check and update the cell number FOR DATE in excel sheet - Completed  (One Time activity - Already done for 1st BT)




#Check and update the cell number in excel sheet - started
$CellNumber = $i +2
$SGSpace.Cells.Item(3,$CellNumber)= $PercentSuccessfulTransactions
$SGSpace.Cells.Item(3,$CellNumber).Interior.ColorIndex = $ColorIndex
$SGSpace.Cells.Item(3,$CellNumber).Font.Color = 16777215

#Check and update the cell number in excel sheet - Completed

Start-Sleep -s 0

}

#Enough, calling REST API - FOR "Business Transaction 2" - Completed



###############################################################################



###################################################################

#Enough, calling REST API - FOR "Business Transaction 3" - Started


for (($i =0); $i -lt $ts; $i++)
{

$StartDateEpoch = (New-TimeSpan -Start $EpochDate -End $sd).TotalMilliseconds  + (86400000*$i)
# Day wise calculation of start time - Epoch format - comment
$EndDateEpoch = $StartDateEpoch + 86400000
# Day wise calculation of end time - Epoch format - comment



#Call rest API for 'Sum of Calls' - started
$controller = "controller.domain.com"
$port = "443/8080"
$protocol = "https/http"



$controllerEndpoint = "controller/rest/applications/SUM-Calls-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=$StartDateEpoch&amp;amp;end-time=$EndDateEpoch"
$restURL = "${protocol}://${controller}:${port}/${controllerEndpoint}"
$restURL
$headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}
$response = Invoke-WebRequest -Uri $restURL -Headers $headers
$response.content
#Call rest API for 'Sum of Calls' - Completed
#Capture 'Sum of Calls' from API response - started
$response -match "&amp;lt;sum&amp;gt;(?&amp;lt;content&amp;gt;.*)&amp;lt;/sum&amp;gt;"
$SumofCalls = $matches['content']
#Capture 'Sum of Calls' from API response - Completed

#if 'Sum of Calls' is 0 or NonInteger, exit script. else powershell will try to divde by 0 - Start
If ($SumofCalls -gt  0) {

#Call rest API for 'Sum of Errors' - started
$controllerEndpoint = "controller/rest/applications/SUM-ERROR-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=$StartDateEpoch&amp;amp;end-time=$EndDateEpoch"
$restURL = "${protocol}://${controller}:${port}/${controllerEndpoint}"
$restURL
$headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}
$response = Invoke-WebRequest -Uri $restURL -Headers $headers
$response.content
#Call rest API for 'Sum of Errors' - Completed
#Capture 'Sum of Errors' from API response - started
$response -match "&amp;lt;sum&amp;gt;(?&amp;lt;content1&amp;gt;.*)&amp;lt;/sum&amp;gt;"
$SumofErrors1 = $matches['content1']
#Capture 'Sum of Errors' from API response - Completed

#Avoid 0 or NonInteger SumofErrors - Started

If ($SumofErrors1 -gt  0) { 
$SumofErrors = $SumofErrors1}
else {
$SumofErrors = 0
}

#Avoid 0 or NonInteger SumofErrors - Completed

#Calculate percentage successfull transaction - started
$PercentSuccessfulTransactions = [math]::Round(((($SumofCalls - $SumofErrors)*100)/$SumofCalls),2)

#Calculate percentage successfull transaction - Completed

#Check background color of metric in excel - started
if ($PercentSuccessfulTransactions  -lt  99.5) { 
$ColorIndex = 3
} else {$ColorIndex = 50}
#Check background color of metric in excel - Completed

} else 
#NonZero PercentSuccessfulTransactions, Else statement - started
{
$PercentSuccessfulTransactions = "NA"
$ColorIndex = 16
}
#NonZero PercentSuccessfulTransactions, Else statement - started


Write-Host ("Itration Number" + $i)
Write-Host ("start date of itration $i - " + $StartDateEpoch)
Write-Host ("End date of itration $i - " + $EndDateEpoch)
Write-Host ("Sum of Calls of itration $i - " + $SumofCalls)
Start-Sleep -s 0

Write-Host ("Sum of Errors of itration $i - " + $SumofErrors)
Write-Host ("Percent Successful Transactions $i - " + $PercentSuccessfulTransactions)
Write-Host ("Color Index of itration $i - " + $ColorIndex)

#Check and update the cell number FOR DATE in excel sheet - started (One Time activity - Already done for 1st BT)
##$CellNumberRow1 = $i +2
##$SGSpace.Cells.Item(1,$CellNumberRow1)= (($sd.AddDays(($i))).ToShortDateString())
##$SGSpace.Cells.Item(1,$CellNumberRow1).Interior.ColorIndex = 24
##$SGSpace.Cells.Item(1,$CellNumberRow1).Font.Bold = $True
#Check and update the cell number FOR DATE in excel sheet - Completed  (One Time activity - Already done for 1st BT)




#Check and update the cell number in excel sheet - started
$CellNumber = $i +2
$SGSpace.Cells.Item(4,$CellNumber)= $PercentSuccessfulTransactions
$SGSpace.Cells.Item(4,$CellNumber).Interior.ColorIndex = $ColorIndex
$SGSpace.Cells.Item(4,$CellNumber).Font.Color = 16777215

#Check and update the cell number in excel sheet - Completed

Start-Sleep -s 0

}

#Enough, calling REST API - FOR "Business Transaction 3" - Completed



###############################################################################


###################################################################

#Enough, calling REST API - FOR "Business Transaction 4" - Started


for (($i =0); $i -lt $ts; $i++)
{

$StartDateEpoch = (New-TimeSpan -Start $EpochDate -End $sd).TotalMilliseconds  + (86400000*$i)
# Day wise calculation of start time - Epoch format - comment
$EndDateEpoch = $StartDateEpoch + 86400000
# Day wise calculation of end time - Epoch format - comment



#Call rest API for 'Sum of Calls' - started
$controller = "controller.domain.com"
$port = "443/8080"
$protocol = "https/http"



$controllerEndpoint = "controller/rest/applications/SUM-Calls-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=$StartDateEpoch&amp;amp;end-time=$EndDateEpoch"
$restURL = "${protocol}://${controller}:${port}/${controllerEndpoint}"
$restURL
$headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}
$response = Invoke-WebRequest -Uri $restURL -Headers $headers
$response.content
#Call rest API for 'Sum of Calls' - Completed
#Capture 'Sum of Calls' from API response - started
$response -match "&amp;lt;sum&amp;gt;(?&amp;lt;content&amp;gt;.*)&amp;lt;/sum&amp;gt;"
$SumofCalls = $matches['content']
#Capture 'Sum of Calls' from API response - Completed

#if 'Sum of Calls' is 0 or NonInteger, exit script. else powershell will try to divde by 0 - Start
If ($SumofCalls -gt  0) {

#Call rest API for 'Sum of Errors' - started
$controllerEndpoint = "controller/rest/applications/SUM-ERROR-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=$StartDateEpoch&amp;amp;end-time=$EndDateEpoch"
$restURL = "${protocol}://${controller}:${port}/${controllerEndpoint}"
$restURL
$headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}
$response = Invoke-WebRequest -Uri $restURL -Headers $headers
$response.content
#Call rest API for 'Sum of Errors' - Completed
#Capture 'Sum of Errors' from API response - started
$response -match "&amp;lt;sum&amp;gt;(?&amp;lt;content1&amp;gt;.*)&amp;lt;/sum&amp;gt;"
$SumofErrors1 = $matches['content1']
#Capture 'Sum of Errors' from API response - Completed

#Avoid 0 or NonInteger SumofErrors - Started

If ($SumofErrors1 -gt  0) { 
$SumofErrors = $SumofErrors1}
else {
$SumofErrors = 0
}

#Avoid 0 or NonInteger SumofErrors - Completed

#Calculate percentage successfull transaction - started
$PercentSuccessfulTransactions = [math]::Round(((($SumofCalls - $SumofErrors)*100)/$SumofCalls),2)

#Calculate percentage successfull transaction - Completed

#Check background color of metric in excel - started
if ($PercentSuccessfulTransactions  -lt  99.5) { 
$ColorIndex = 3
} else {$ColorIndex = 50}
#Check background color of metric in excel - Completed

} else 
#NonZero PercentSuccessfulTransactions, Else statement - started
{
$PercentSuccessfulTransactions = "NA"
$ColorIndex = 16
}
#NonZero PercentSuccessfulTransactions, Else statement - started


Write-Host ("Itration Number" + $i)
Write-Host ("start date of itration $i - " + $StartDateEpoch)
Write-Host ("End date of itration $i - " + $EndDateEpoch)
Write-Host ("Sum of Calls of itration $i - " + $SumofCalls)
Start-Sleep -s 0

Write-Host ("Sum of Errors of itration $i - " + $SumofErrors)
Write-Host ("Percent Successful Transactions $i - " + $PercentSuccessfulTransactions)
Write-Host ("Color Index of itration $i - " + $ColorIndex)

#Check and update the cell number FOR DATE in excel sheet - started (One Time activity - Already done for 1st BT)
##$CellNumberRow1 = $i +2
##$SGSpace.Cells.Item(1,$CellNumberRow1)= (($sd.AddDays(($i))).ToShortDateString())
##$SGSpace.Cells.Item(1,$CellNumberRow1).Interior.ColorIndex = 24
##$SGSpace.Cells.Item(1,$CellNumberRow1).Font.Bold = $True
#Check and update the cell number FOR DATE in excel sheet - Completed  (One Time activity - Already done for 1st BT)




#Check and update the cell number in excel sheet - started
$CellNumber = $i +2
$SGSpace.Cells.Item(5,$CellNumber)= $PercentSuccessfulTransactions
$SGSpace.Cells.Item(5,$CellNumber).Interior.ColorIndex = $ColorIndex
$SGSpace.Cells.Item(5,$CellNumber).Font.Color = 16777215
$selection = $SGSpace.usedRange

#Check and update the cell number in excel sheet - Completed

Start-Sleep -s 0

}

#Enough, calling REST API - FOR "Business Transaction 4" - Completed


###############################################################################



#Allignment and border - started

$selection = $SGSpace.usedRange
$selection.select()
$selection.HorizontalAlignment = -4108 #center
$selection.Borders.LineStyle = 1

$selection = $SGSpace.range("A2:A5")
$selection.select()
$selection.HorizontalAlignment = -4131 #Left


$SGSpace.application.activewindow.splitcolumn = 1
$SGSpace.application.activewindow.freezepanes = $true

#Allignment and border - completed


# Save updated Excel Sheet - comment
$workbook.SaveAs('h:\SahilTempExcelAppDReport.xlsx')
$excel.Quit()

Start-Sleep -s 1


Rename-Item -path "h:\SahilTempExcelAppDReport.xlsx" -NewName ($ExcelName) -Force
#EXCEL Editing - completed

Start-Sleep -s 1


[System.Windows.MessageBox]::Show("                                      Your Report is ready!!

File Location: H:\'$ExcelName'

                                     Sahil Gupta - SahiljGupta@gmail.com")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jan 2021 10:53:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736934#M10147</guid>
      <dc:creator>Sahil_Gupta</dc:creator>
      <dc:date>2021-01-19T10:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Performance SLA Calculation using AppDynamics REST API | Individual Business Transaction | PowerShell</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736935#M10148</link>
      <description>&lt;P&gt;hello Sahil,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;first of all thanks for the code.&lt;/P&gt;&lt;P&gt;I got some errors when I wanted to use it. I wanted to change the url here. I wrote application id instead of "SUM-Calls-PER-MIN-ENDPOINT", but I still couldn't run it.&lt;/P&gt;&lt;P&gt;Also, how can I see the response results for a single url?&lt;/P&gt;&lt;P&gt;When I say $response it is empty.&lt;/P&gt;&lt;P&gt;I request your help.&lt;/P&gt;&lt;P&gt;$controllerEndpoint = "controller/rest/applications/SUM-Calls-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=$StartDateEpoch&amp;amp;end-time=$EndDateEpoch"&lt;BR /&gt;PS D:\Users\halerol&amp;gt; $restURL = "${protocol}://${controller}:${port}/${controllerEndpoint}"&lt;BR /&gt;PS D:\Users\halerol&amp;gt; $restURL&lt;BR /&gt;&lt;A href="https://appd:443/controller/rest/applications/SUM-Calls-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=&amp;amp;end-time=" target="_blank" rel="noopener nofollow noreferrer"&gt;https://appd:443/controller/rest/applications/SUM-Calls-PER-MIN-ENDPOINT/&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=&amp;amp;end-time=&lt;/A&gt;&lt;BR /&gt;PS D:\Users\xxx&amp;gt; $headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}&lt;/P&gt;&lt;P&gt;PS D:\Users\xxx&amp;gt; $headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:${password}"))}&lt;BR /&gt;PS D:\Users\xxx&amp;gt; $response = Invoke-WebRequest -Uri $restURL -Headers $headers&lt;BR /&gt;Invoke-WebRequest : HTTP Status 400 - Invalid application id sum-calls-per-min-endpoint is specified&lt;BR /&gt;type Status report&lt;BR /&gt;messageInvalid application id sum-calls-per-min-endpoint is specified&lt;BR /&gt;descriptionThe request sent by the client was syntactically incorrect.&lt;BR /&gt;At line:1 char:13&lt;BR /&gt;+ $response = Invoke-WebRequest -Uri $restURL -Headers $headers&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 12:15:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736935#M10148</guid>
      <dc:creator>Haluk_Yaşar_Ero</dc:creator>
      <dc:date>2022-04-19T12:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Performance SLA Calculation using AppDynamics REST API | Individual Business Transaction | PowerShell</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736936#M10149</link>
      <description>&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;Hello&amp;nbsp;&lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/147481"&gt;@Haluk Yaşar.Erol&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;I am the same Sahil, with just a new ID &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;Thank you for your question. Here are a few things I can suggest:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;#The script shared above works ONLY with Windows PowerShell. I used it so most of us can run it from our local desktop without any additional software.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;1) Always copy the URL from Metric Browser. Check, screenshot1 attached&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;2) SUM-Calls-PER-MIN-ENDPOINT is NOT a valid API to call. We call the Calls%20per%20Minute API, the output of which gives us SUM/Count/current/Max/Min.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;&lt;A href="https://docs.appdynamics.com/21.7/en/extend-appdynamics/appdynamics-apis/metric-and-snapshot-api#MetricandSnapshotAPI-FullExample:.2" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.appdynamics.com/21.7/en/extend-appdynamics/appdynamics-apis/metric-and-snapshot-api#MetricandSnapshotAPI-FullExample:.2&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;I will suggest you first try the basic AppDynamics APIs with PowerShell.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;A good place to start?&amp;nbsp;&lt;/SPAN&gt;&lt;A class="editor-rtfLink" href="https://community.appdynamics.com/t5/Knowledge-Base/How-do-I-use-REST-API-calls-in-a-PowerShell-script/ta-p/37193" target="_blank"&gt;&lt;SPAN data-preserver-spaces="true"&gt;https://community.appdynamics.com/t5/Knowledge-Base/How-do-I-use-REST-API-calls-in-a-PowerShell-script/ta-p/37193&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;Additional Info: How to change time in AppD REST API?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;&lt;A href="https://docs.appdynamics.com/21.7/en/extend-appdynamics/appdynamics-apis/metric-and-snapshot-api#MetricandSnapshotAPI-usingtimerangesUsingTimeRanges" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.appdynamics.com/21.7/en/extend-appdynamics/appdynamics-apis/metric-and-snapshot-api#MetricandSnapshotAPI-usingtimerangesUsingTimeRanges&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;More about AppD Metric REST API?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;&lt;A href="https://docs.appdynamics.com/21.7/en/extend-appdynamics/appdynamics-apis/metric-and-snapshot-api" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.appdynamics.com/21.7/en/extend-appdynamics/appdynamics-apis/metric-and-snapshot-api&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-preserver-spaces="true"&gt;Sahil Gupta&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 13:03:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736936#M10149</guid>
      <dc:creator>Sahil_Gupta2</dc:creator>
      <dc:date>2022-04-19T13:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Performance SLA Calculation using AppDynamics REST API | Individual Business Transaction | PowerShell</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736937#M10150</link>
      <description>&lt;P&gt;Hello Sahil,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;BR /&gt;I will look into the links you shared.&lt;/P&gt;&lt;P&gt;How can we get the results by putting certain filters in X application.&lt;/P&gt;&lt;P&gt;Sample ;&lt;BR /&gt;in app X&lt;BR /&gt;Critical Category&lt;BR /&gt;Service in 7x24 period&lt;BR /&gt;Number of Calls &amp;gt; 10 and Response Time &amp;gt; 3s&lt;BR /&gt;Minor Category&lt;/P&gt;&lt;P&gt;Service in 7x24 period&lt;BR /&gt;Number of Calls &amp;gt; 10 to 1s 3s&lt;BR /&gt;Number of Calls &amp;gt; 1 and Response Time &amp;gt; 5s&lt;BR /&gt;Warning Category&lt;/P&gt;&lt;P&gt;Service in 7x24 period&lt;BR /&gt;1 &amp;lt; Number of Calls &amp;lt; Between 10 and 1s &amp;lt; 5s&lt;/P&gt;&lt;P&gt;How can I get the data in the categories here with api or powershell?&lt;/P&gt;&lt;P&gt;I do this with filters over standard appdynamics manually every month. I want to do it with script or with api, but I don't know much about these issues. If you have a chance to try, I would like you to share examples.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 14:27:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736937#M10150</guid>
      <dc:creator>Haluk_Yaşar_Ero</dc:creator>
      <dc:date>2022-04-19T14:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Performance SLA Calculation using AppDynamics REST API | Individual Business Transaction | PowerShell</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736938#M10151</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/147481"&gt;@Haluk Yaşar.Erol&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;

&lt;P&gt;I would suggest you to use Dexter.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.cisco.com/codeexchange/github/repo/Appdynamics/AppDynamics.DEXTER" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.cisco.com/codeexchange/github/repo/Appdynamics/AppDynamics.DEXTER&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Creating a script from scratch is hell lot of a task and time-consuming.&lt;/P&gt;


&lt;P&gt;#Not sure if I understood your request correctly, though if your goal includes to report how many Number/SUM-of-transactions in last 1 MONTH had response time &amp;gt; 3sec(or whatever), I think this is not archivable. AppD rolls up the data captured at 1 minute average. There is NO record for response time of individual transactions (except snapshot).&lt;/P&gt;

&lt;P&gt;Metric Data Resolution over Time?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.appdynamics.com/22.3/en/appdynamics-essentials/metrics-and-graphs/metric-data-resolution-over-time" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.appdynamics.com/22.3/en/appdynamics-essentials/metrics-and-graphs/metric-data-resolution-over-time&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sahil Gupta&lt;/P&gt;

&lt;DIV id="On-prem" class="cfm tabs-pane  conf-macro output-block active-pane" role="tabpanel" data-pane-title="On-prem" data-hasbody="true" data-macro-name="auitabspage"&gt;

&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Apr 2022 14:46:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Performance-SLA-Calculation-using-AppDynamics-REST-API/m-p/736938#M10151</guid>
      <dc:creator>Sahil_Gupta2</dc:creator>
      <dc:date>2022-04-19T14:46:22Z</dc:date>
    </item>
  </channel>
</rss>

