Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telemetry Enhancemet #2800

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Ginger/Ginger/ALM/ALMConnectionPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.

using amdocs.ginger.GingerCoreNET;
using Amdocs.Ginger.Common;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using GingerCore.ALM;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -395,9 +396,12 @@ private void ConnectProjectButton_Click(object sender, RoutedEventArgs e)
if(ConnectProjectButton.Content.ToString() == "Save Project Mapping")
{
SaveConnectionDetails();
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.AlmExport.ToString(), true, true);
return;
}
ConnectProject();
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.AlmImport.ToString(), true, true);

}

private void SaveConnectionDetails()
Expand Down
3 changes: 3 additions & 0 deletions Ginger/Ginger/ALM/MapToALMWizard/AddMapToALMWizard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
#endregion
using amdocs.ginger.GingerCoreNET;
using Amdocs.Ginger.Common;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Ginger.WizardLib;
using GingerCore;
using GingerCore.Activities;
Expand Down Expand Up @@ -134,6 +135,8 @@ public override void Finish()
Reporter.ToStatus(eStatusMsgKey.SaveItem, null, mapBusinessFlow.Name, GingerDicser.GetTermResValue(eTermResKey.BusinessFlow));
WorkSpace.Instance.SolutionRepository.SaveRepositoryItem(mapBusinessFlow);
Reporter.HideStatusMessage();

UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.ALM.ToString(), true, true);
}
catch (Exception ex)
{
Expand Down
4 changes: 4 additions & 0 deletions Ginger/Ginger/Actions/ActionEditPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ limitations under the License.
using Amdocs.Ginger.Common.Enums;
using Amdocs.Ginger.Common.Expressions;
using Amdocs.Ginger.Common.UIElement;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Amdocs.Ginger.Repository;
using Ginger.Actions.UserControls;
using Ginger.BusinessFlowPages;
Expand Down Expand Up @@ -475,7 +476,10 @@ private void ClearUnusedParameter(object sender, RoutedEventArgs e)
private void RefreshOutputColumns(object sender, RoutedEventArgs e)
{
if (mAction.SupportSimulation)
{
xOutputValuesGrid.ChangeGridView(eGridView.All.ToString());
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.ActionResultSimulation.ToString(), true, true);
}
else
xOutputValuesGrid.ChangeGridView(eGridView.NonSimulation.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.
using amdocs.ginger.GingerCoreNET;
using Amdocs.Ginger.Common;
using Amdocs.Ginger.Common.UIElement;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Ginger.Actions._Common.ActUIElementLib;
using GingerCore;
using GingerCore.Actions;
Expand Down Expand Up @@ -182,6 +183,8 @@ private void OpenResultsURL_Click(object sender, RoutedEventArgs e)
{
//First try open with Chrome
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo() { FileName = "chrome.exe", Arguments = url , UseShellExecute = true });
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.Applitools.ToString(), true, true);

}
catch (Exception ex)
{
Expand All @@ -190,6 +193,7 @@ private void OpenResultsURL_Click(object sender, RoutedEventArgs e)
//Try open with Firefox
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo() { FileName = "firefox.exe", Arguments = url, UseShellExecute = true });
Reporter.ToLog(eLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {ex.Message}", ex);
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.Applitools.ToString(), true, true);
}
catch (Exception ee)
{
Expand Down
2 changes: 2 additions & 0 deletions Ginger/Ginger/AnalyzerLib/AnalyzerPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.

using amdocs.ginger.GingerCoreNET;
using Amdocs.Ginger.Common;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Ginger.Actions;
using Ginger.BusinessFlowWindows;
using Ginger.Run;
Expand Down Expand Up @@ -646,6 +647,7 @@ public void ShowAsWindow(eWindowShowStyle windowStyle = eWindowShowStyle.Free)
finally
{
BusyInProcess = false;
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.Analyzer.ToString(), false, true);
}
SetStatus("Finished to Fix Selected Items.");
StatusLabel.Visibility = Visibility.Collapsed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ limitations under the License.
*/
#endregion

using amdocs.ginger.GingerCoreNET;
using Amdocs.Ginger.Common;
using Amdocs.Ginger.Common.Repository.ApplicationModelLib;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Amdocs.Ginger.Repository;
using Ginger.ApplicationModelsLib.APIModels;
using Ginger.ApplicationModelsLib.APIModels.APIModelWizard;
Expand Down Expand Up @@ -115,6 +117,8 @@ public override void Finish()
}

ImportAPIModels(General.ConvertListToObservableList(LearnedAPIModelsList.Where(x => x.IsSelected == true).ToList()));

UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.ApiModel.ToString(), true, true);
}

private void ImportAPIModels(ObservableList<ApplicationAPIModel> SelectedAAMList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.

using amdocs.ginger.GingerCoreNET;
using Amdocs.Ginger.Common;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Amdocs.Ginger.Repository;
using Ginger;
using Ginger.ApplicationsModels.ModelsUsages;
Expand Down Expand Up @@ -125,7 +126,10 @@ private void AddReturnValue(object sender, RoutedEventArgs e)
private void RefreshOutputColumns(object sender, RoutedEventArgs e)
{
if (mApplicationAPIModel.SupportSimulation)
{
xOutputValuesGrid.ChangeGridView(eGridView.All.ToString());
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.ActionResultSimulation.ToString(), true, true);
}
else
xOutputValuesGrid.ChangeGridView(eGridView.NonSimulation.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ limitations under the License.
using System;
using Ginger.SolutionWindows.TreeViewItems;
using Amdocs.Ginger.Common.Repository;
using Amdocs.Ginger.CoreNET.TelemetryLib;

namespace GingerWPF.ApplicationModelsLib.APIModelWizard
{
Expand Down Expand Up @@ -325,10 +326,13 @@ private void AddGlobalParam(object sender, RoutedEventArgs e)
ModelsGlobalParamsPage MGPP = new ModelsGlobalParamsPage(true);
List<GlobalAppModelParameter> globalParamsToAdd = MGPP.ShowAsWindow();
if (globalParamsToAdd != null)
{
foreach (GlobalAppModelParameter GAMP in globalParamsToAdd)
{
AddGlobalParametertoAPIGlobalParameterList(APIGlobalParamList, GAMP);
}
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.ModelParameters.ToString(), true, false);
}
}

private void DeleteParams_Clicked(object sender, RoutedEventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ limitations under the License.
using System.Windows.Media;
using Ginger.SolutionWindows.TreeViewItems;
using Amdocs.Ginger.Common.Repository;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Ginger.UserControlsLib;

namespace GingerWPF.ApplicationModelsLib.ModelParams_Pages
Expand Down Expand Up @@ -529,11 +530,13 @@ private void DeleteGlobalParam(RepositoryItemBase globalParamToDelete)
private void SaveAllGlobalParametersChanges(object sender, RoutedEventArgs e)
{
Save(true);
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.ModelParameters.ToString(), true, false);
}

private void SaveSelectedGlobalParametersChanges(object sender, RoutedEventArgs e)
{
Save(false);
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.ModelParameters.ToString(), true, false);
}

private void Save(bool saveAll)
Expand Down Expand Up @@ -619,10 +622,17 @@ private void CloseWinClicked(object sender, EventArgs e)

protected override void IsVisibleChangedHandler(object sender, DependencyPropertyChangedEventArgs e)
{
if (xModelsGlobalParamsGrid.grdMain.Items.Count != 0 && xModelsGlobalParamsGrid.grdMain.SelectedItems[0] != null)
try
{
if (xModelsGlobalParamsGrid.grdMain.Items.Count != 0 && xModelsGlobalParamsGrid.grdMain.SelectedItems[0] != null)
{
CurrentItem = (RepositoryItemBase)xModelsGlobalParamsGrid.grdMain.SelectedItems[0];
base.IsVisibleChangedHandler(sender, e);
}
}
catch(Exception ex)
{
CurrentItem = (RepositoryItemBase)xModelsGlobalParamsGrid.grdMain.SelectedItems[0];
base.IsVisibleChangedHandler(sender, e);
Reporter.ToLog(eLogLevel.ERROR, "Error: ", ex);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Ginger/Ginger/DataSource/AddNewDataSourcePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ private void OKButton_Click(object sender, RoutedEventArgs e)
}
}

mTargetFolder.AddRepositoryItem(mDSDetails);


mTargetFolder.AddRepositoryItem(mDSDetails);
_pageGenericWin.Close();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public override void Finish()

//Save the Environment
EnvsFolder.AddRepositoryItem(NewEnvironment);

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ limitations under the License.
using System.Windows.Input;
using System.Text.RegularExpressions;
using Ginger.ValidationRules;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Ginger.UserControlsLib;

namespace Ginger.Configurations
Expand Down Expand Up @@ -79,6 +80,7 @@ private void CallSealightsConfigPropertyChange()
private void xSaveButton_Click(object sender, RoutedEventArgs e)
{
WorkSpace.Instance.Solution.SolutionOperations.SaveSolution(true, SolutionGeneral.Solution.eSolutionItemToSave.LoggerConfiguration);
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.Applitools.ToString(), true, false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ limitations under the License.
using System.Windows.Input;
using System.Text.RegularExpressions;
using Ginger.ValidationRules;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Ginger.UserControlsLib;

namespace Ginger.Configurations
Expand Down Expand Up @@ -102,12 +103,20 @@ private void CallSealightsConfigPropertyChange()
private void xSaveButton_Click(object sender, RoutedEventArgs e)
{
WorkSpace.Instance.Solution.SolutionOperations.SaveSolution(true, SolutionGeneral.Solution.eSolutionItemToSave.LoggerConfiguration);

Enum.TryParse(sealightsRadioButtonValue, out SealightsConfiguration.eSealightsLog sealightsLog);

if (sealightsLog == SealightsConfiguration.eSealightsLog.Yes)
{
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.Sealights.ToString(), true, true);
}
}

string sealightsRadioButtonValue;
private void SealightsLogRadioButton_CheckedHandler(object sender, RoutedEventArgs e)
{
string value = ((RadioButton)sender).Tag?.ToString();

sealightsRadioButtonValue = value;
SealightsConfiguration.eSealightsLog sealightsLog;

Enum.TryParse(value, out sealightsLog);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ limitations under the License.
using System.Windows.Input;
using System.Text.RegularExpressions;
using Ginger.ValidationRules;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Ginger.UserControlsLib;

namespace Ginger.Configurations
Expand Down Expand Up @@ -94,6 +95,7 @@ private void CallVRTConfigPropertyChange()
private void xSaveButton_Click(object sender, RoutedEventArgs e)
{
WorkSpace.Instance.Solution.SolutionOperations.SaveSolution(true, SolutionGeneral.Solution.eSolutionItemToSave.LoggerConfiguration);
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.VRT.ToString(), true, false);
}

private void Page_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
Expand Down
5 changes: 5 additions & 0 deletions Ginger/Ginger/Functionalities/FindAndReplacePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.
using amdocs.ginger.GingerCoreNET;
using Amdocs.Ginger.Common;
using Amdocs.Ginger.Common.Functionalities;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using Amdocs.Ginger.Repository;
using Ginger.Actions;
using Ginger.Run;
Expand Down Expand Up @@ -351,6 +352,8 @@ private void ReplaceButtonClicked(object sender, RoutedEventArgs e)
}

ReplaceItemsAsync();

UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.Search.ToString(), false, true);
}

private async void ReplaceItemsAsync()
Expand Down Expand Up @@ -399,6 +402,8 @@ private void ReplaceItems(List<FoundItem> FIList, string newValue)
private void FindButtonClicked(object sender, RoutedEventArgs e)
{
Find();

UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.Search.ToString(), false, true);
}

private void Find()
Expand Down
14 changes: 13 additions & 1 deletion Ginger/Ginger/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ public void Init()

private void ReporterDataChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(ReporterData.ErrorCounter))
if (e.PropertyName == nameof(ReporterData.ErrorCounter) && WorkSpace.Instance != null)
{
if (!string.IsNullOrEmpty(Reporter.ReporterData.LastLoggedError))
{
WorkSpace.Instance.Telemetry.TelemetrySession.ExceptionErrors.Add(Reporter.ReporterData.LastLoggedError);
}
this.Dispatcher.BeginInvoke(
System.Windows.Threading.DispatcherPriority.Normal,
new Action(
Expand All @@ -197,6 +201,13 @@ private void ReporterDataChanged(object sender, PropertyChangedEventArgs e)
}
));
}
if (e.PropertyName == nameof(ReporterData.LastLoggedError))
{
if (!string.IsNullOrEmpty(Reporter.ReporterData.LastLoggedError) && WorkSpace.Instance != null)
{
WorkSpace.Instance.Telemetry.TelemetrySession.ExceptionErrors.Add(Reporter.ReporterData.LastLoggedError);
}
}
}


Expand Down Expand Up @@ -664,6 +675,7 @@ private void ViewSolutionFiles_Click(object sender, RoutedEventArgs e)

private void btnSourceControlConnectionDetails_Click(object sender, RoutedEventArgs e)
{

SourceControlConnDetailsPage p = new SourceControlConnDetailsPage();
p.ShowAsWindow(eWindowShowStyle.Dialog);
}
Expand Down
16 changes: 16 additions & 0 deletions Ginger/Ginger/Reports/ExecutionResultsConfiguration.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ limitations under the License.
using System.Windows.Input;
using System.Text.RegularExpressions;
using Ginger.ValidationRules;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using static Ginger.Reports.ExecutionLoggerConfiguration;
using Ginger.UserControlsLib;

namespace Ginger.Reports
Expand Down Expand Up @@ -197,6 +199,20 @@ private void xSaveButton_Click(object sender, RoutedEventArgs e)

WorkSpace.Instance.Solution.SolutionOperations.SaveSolution(true, SolutionGeneral.Solution.eSolutionItemToSave.LoggerConfiguration);

bool isLogger = Enum.TryParse(WorkSpace.Instance.Solution.LoggerConfigurations.SelectedDataRepositoryMethod.ToString(), out TelemetrySession.GingerUsedFeatures selectedLogger);
if (isLogger)
{
UsedFeatureDetail.AddOrModifyFeatureDetail(selectedLogger.ToString(), true, true);
}
if (WorkSpace.Instance.Solution.LoggerConfigurations.PublishLogToCentralDB == ePublishToCentralDB.Yes)
{
bool isCentralizedDB = Enum.TryParse(WorkSpace.Instance.Solution.LoggerConfigurations.DataPublishingPhase.ToString(), out TelemetrySession.GingerUsedFeatures publishPhase);
if (isCentralizedDB)
{
UsedFeatureDetail.AddOrModifyFeatureDetail(publishPhase.ToString(), true, true);
}
}

// validate the paths of inserted folders
Ginger.Reports.GingerExecutionReport.ExtensionMethods.GetReportDirectory(WorkSpace.Instance.Solution.LoggerConfigurations.ExecutionLoggerConfigurationHTMLReportsFolder);
}
Expand Down
2 changes: 2 additions & 0 deletions Ginger/Ginger/Run/GingerSelfHealingConfiguration.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.

using amdocs.ginger.GingerCoreNET;
using Amdocs.Ginger.Common.SelfHealingLib;
using Amdocs.Ginger.CoreNET.TelemetryLib;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -80,6 +81,7 @@ public void ShowAsWindow()
private void xEnableSelfHealingChkBox_Click(object sender, RoutedEventArgs e)
{
ShowHideConfigPanel();
UsedFeatureDetail.AddOrModifyFeatureDetail(TelemetrySession.GingerUsedFeatures.SelfHealing.ToString(), true, true);
}

private void ShowHideConfigPanel()
Expand Down
Loading