Skip to content

Commit

Permalink
Fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidWiseman committed Sep 7, 2024
1 parent c891225 commit 49a17a1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion DBADashDB/dbo/Stored Procedures/AgentJobThresholds_Get.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@JobID UNIQUEIDENTIFIER
)
AS
SELECT InstanceId,
SELECT InstanceID,
job_id,
TimeSinceLastFailureWarning,
TimeSinceLastFailureCritical,
Expand Down
4 changes: 2 additions & 2 deletions DBADashDB/dbo/Stored Procedures/AgentJobThresholds_Upd.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ SET NOCOUNT ON

BEGIN TRAN
DELETE dbo.AgentJobThresholds
WHERE InstanceId = @InstanceId
WHERE InstanceID = @InstanceId
AND job_id = @job_id

IF @Inherit=0
BEGIN

INSERT INTO dbo.AgentJobThresholds
(
InstanceId,
InstanceID,
job_id,
TimeSinceLastFailureWarning,
TimeSinceLastFailureCritical,
Expand Down
2 changes: 1 addition & 1 deletion DBADashDB/dbo/Stored Procedures/Instance_Del.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ BEGIN
END

DELETE dbo.AgentJobThresholds
WHERE InstanceId = @InstanceID
WHERE InstanceID = @InstanceID

DELETE dbo.Alerts
WHERE InstanceID=@InstanceID
Expand Down
4 changes: 2 additions & 2 deletions DBADashDB/dbo/Tables/AgentJobThresholds.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CREATE TABLE dbo.AgentJobThresholds(
InstanceId INT NOT NULL,
InstanceID INT NOT NULL,
job_id UNIQUEIDENTIFIER NOT NULL,
TimeSinceLastFailureWarning INT NULL,
TimeSinceLastFailureCritical INT NULL,
Expand All @@ -16,7 +16,7 @@
LastFailIsCritical BIT NOT NULL,
LastFailIsWarning BIT NOT NULL,
AgentIsRunningCheck BIT NOT NULL CONSTRAINT DF_AgentIsRunningCheck DEFAULT (1),
CONSTRAINT PK_AgentJobThresholds PRIMARY KEY CLUSTERED (InstanceId ASC, job_id ASC)
CONSTRAINT PK_AgentJobThresholds PRIMARY KEY CLUSTERED (InstanceID ASC, job_id ASC)
);


4 changes: 2 additions & 2 deletions DBADashDB/dbo/Tables/DBADashAgent.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
AgentPath NVARCHAR(260) NOT NULL,
MessagingEnabled BIT NOT NULL CONSTRAINT DF_DBADashAgent_MessagingEnabled DEFAULT(0),
ServiceSQSQueueUrl NVARCHAR(256) NULL,
AgentIdentifier CHAR(22) NOT NULL CONSTRAINT DF_DBADAshAgent_AgentIdentifier DEFAULT(LEFT(CONCAT('Temp.',REPLACE(NEWID(),'-','')),22)),
AgentIdentifier CHAR(22) NOT NULL CONSTRAINT DF_DBADashAgent_AgentIdentifier DEFAULT (left(concat('Temp.',replace(newid(),'-','')),(22))),
S3Path NVARCHAR(256) NULL,
CONSTRAINT PK_DBADashAgent PRIMARY KEY(DBADashAgentID),
INDEX IX_DBADashAgent UNIQUE NONCLUSTERED (AgentHostName,AgentServiceName),
INDEX IX_DBADashAgent_AgentIdentifier UNIQUE NONCLUSTERED (AgentIdentifier)
)
)
6 changes: 3 additions & 3 deletions DBADashDB/dbo/Views/AgentJobStatus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SELECT J.Instance,
cfg.JobStepFails7DaysCritical,
cfg.LastFailIsCritical,
cfg.LastFailIsWarning,
CASE WHEN cfg.job_id='00000000-0000-0000-0000-000000000000' AND cfg.InstanceId=-1 THEN 'Root'
CASE WHEN cfg.job_id='00000000-0000-0000-0000-000000000000' AND cfg.InstanceID =-1 THEN 'Root'
WHEN cfg.job_id='00000000-0000-0000-0000-000000000000' THEN 'Instance'
WHEN cfg.job_id IS NULL THEN 'N/A'
ELSE 'Job' END AS ConfiguredLevel,
Expand Down Expand Up @@ -98,9 +98,9 @@ CROSS APPLY dbo.SecondsToHumanDuration(J.MaxDurationSec) AS MaxD
CROSS APPLY dbo.SecondsToHumanDuration(J.AvgDurationSec) AS AvgD
OUTER APPLY(SELECT TOP(1) *
FROM dbo.AgentJobThresholds T
WHERE (T.InstanceId = J.InstanceID OR T.InstanceId =-1)
WHERE (T.InstanceID = J.InstanceID OR T.InstanceID =-1)
AND (T.job_id = J.job_id OR T.job_id ='00000000-0000-0000-0000-000000000000')
ORDER BY T.InstanceId DESC,T.job_id DESC) cfg
ORDER BY T.InstanceID DESC,T.job_id DESC) cfg
OUTER APPLY(SELECT CASE WHEN J.enabled=0 THEN 3 /* N/A. Job not enabled */
WHEN (J.TimeSinceLastFailedMin <= cfg.TimeSinceLastFailureCritical OR J.TimeSinceLastFailedMin <= cfg.TimeSinceLastFailureWarning)
AND J.AckDate > ISNULL(J.LastFailed,'19000101') THEN 5 /* Acknowledged. Warning or Critical threshold met but acknowledged date greater than last failed */
Expand Down
5 changes: 1 addition & 4 deletions DBADashGUI/Performance/QueryStorePlanChart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,12 @@ public static string FormatDateForChartLabel(DateTime date, TimeSpan duration, C
case < 1:
// Less than 1 day: Show time only
return date.ToString(cultureInfo.DateTimeFormat.ShortTimePattern, cultureInfo);
break;

case < 7:
{
// Less than 7 days: Show day and time
var dayName = date.ToString("ddd", cultureInfo); // Short day name
return $"{dayName} {date.ToString(cultureInfo.DateTimeFormat.ShortTimePattern, cultureInfo)}";
break;
}
default:
{
Expand All @@ -184,7 +182,6 @@ public static string FormatDateForChartLabel(DateTime date, TimeSpan duration, C
// Different years: Show the full date
cultureInfo.DateTimeFormat.ShortDatePattern;
return date.ToString(dateFormat, cultureInfo).Trim();
break;
}
}
}
Expand Down Expand Up @@ -393,7 +390,7 @@ private static DateTime GetMidpoint(DateTime start, DateTime end)
// Custom Tooltip to show plan metrics
public class CustomTooltip : IChartTooltip<SkiaSharpDrawingContext>
{
private StackPanel<RoundedRectangleGeometry, SkiaSharpDrawingContext>? _stackPanel;
private StackPanel<RoundedRectangleGeometry, SkiaSharpDrawingContext> _stackPanel;
private static readonly int s_zIndex = 10100;
private readonly SolidColorPaint _backgroundPaint = new(DashColors.TrimbleBlueDark.ToSKColor());
private readonly SolidColorPaint _fontPaint = new(new SKColor(230, 230, 230)) { ZIndex = s_zIndex + 1 };
Expand Down
2 changes: 1 addition & 1 deletion DBADashGUI/Performance/QueryStoreTopQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ private void DgvDrillDown_RowsAdded(object sender, DataGridViewRowsAddedEventArg
}
}

private async void DrillDownTabIndexChanged(object sender, EventArgs e)
private void DrillDownTabIndexChanged(object sender, EventArgs e)
{
QueryDrillDown();
}
Expand Down

0 comments on commit 49a17a1

Please sign in to comment.