Skip to content

Commit

Permalink
Merge pull request #16 from progress/develop
Browse files Browse the repository at this point in the history
Merging from Develop
  • Loading branch information
DustinGrau-PSC authored Oct 28, 2019
2 parents 4307a47 + cae1aca commit 4b4dddd
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 28 deletions.
Binary file modified dist/oe11/Diagnostic.pl
Binary file not shown.
Binary file modified dist/oe11/Spark.pl
Binary file not shown.
Binary file modified dist/oe12/Diagnostic.pl
Binary file not shown.
Binary file modified dist/oe12/Spark.pl
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Spark/Diagnostic/Util/OEMetrics.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1111,8 +1111,8 @@ class Spark.Diagnostic.Util.OEMetrics inherits Spark.Diagnostic.Util.Logger use-
oRemoteMetrics:GetRequestMetrics(input this-object:ApplicationName, input piAgentID, output oRequests).

do iX = 1 to oRequests:Length:
/* If a request occured prior to the last report from this session, delete the object. */
if oRequests:GetJsonObject(iX):GetDatetime("StartTime") lt dLastReportOutput then
/* If a request ended prior to the last report from this session, delete the object. */
if oRequests:GetJsonObject(iX):GetDatetime("EndTime") le dLastReportOutput then
assign iCount = iX.
end. /* do iX */

Expand Down
30 changes: 14 additions & 16 deletions src/Spark/Diagnostic/Util/OEMetricsConfig.cls
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,20 @@ class Spark.Diagnostic.Util.OEMetricsConfig inherits Spark.Diagnostic.Util.OSPat


method private void Discovery ( ):
define variable cCatalinaBase as character no-undo.
define variable cMetricsConfig as character no-undo.
define variable cLine as character no-undo.
define variable cAppName as character no-undo.
define variable cAppNames as character no-undo.
define variable cWebApp as character no-undo.
define variable cTransport as character no-undo.
define variable lcConfigTemp as longchar no-undo.
define variable iLines as integer no-undo.
define variable iLine as integer no-undo.
define variable iX as integer no-undo.
define variable iHttpPort as integer no-undo.
define variable iHttpsPort as integer no-undo.
define variable lFound as logical no-undo.
define variable dLastDate as datetime no-undo.
define variable oWebAppList as JsonArray no-undo.
define variable cLine as character no-undo.
define variable cAppName as character no-undo.
define variable cAppNames as character no-undo.
define variable cWebApp as character no-undo.
define variable cTransport as character no-undo.
define variable lcConfigTemp as longchar no-undo.
define variable iLines as integer no-undo.
define variable iLine as integer no-undo.
define variable iX as integer no-undo.
define variable iHttpPort as integer no-undo.
define variable iHttpsPort as integer no-undo.
define variable lFound as logical no-undo.
define variable dLastDate as datetime no-undo.
define variable oWebAppList as JsonArray no-undo.

/* Examine the catalina.properties for info about the available ports. */
file-info:file-name = substitute("&1/conf/catalina.properties", this-object:CatalinaBase).
Expand Down
20 changes: 11 additions & 9 deletions src/Spark/Diagnostic/Util/RemoteMetrics.cls
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@
Notes : Requires OpenEdge 11.7.3 or later!
----------------------------------------------------------------------*/

using Progress.Lang.* from propath.
using Progress.Json.ObjectModel.* from propath.
using OpenEdge.Core.Assert from propath.

block-level on error undo, throw.

using OpenEdge.Net.HTTP.Credentials from propath.
using OpenEdge.Net.HTTP.HttpClient from propath.
using OpenEdge.Net.HTTP.MethodEnum from propath.
using OpenEdge.Net.HTTP.IHttpRequest from propath.
using OpenEdge.Net.HTTP.IHttpResponse from propath.
using OpenEdge.Net.HTTP.MethodEnum from propath.
using OpenEdge.Net.HTTP.RequestBuilder from propath.
using OpenEdge.Net.HTTP.IAuthenticatedRequest from propath.

block-level on error undo, throw.
using Progress.Json.ObjectModel.JsonArray from propath.
using Progress.Json.ObjectModel.JsonDataType from propath.
using Progress.Json.ObjectModel.JsonObject from propath.
using Progress.Json.ObjectModel.ObjectModelParser from propath.
using Progress.Lang.AppError from propath.

class Spark.Diagnostic.Util.RemoteMetrics inherits Spark.Diagnostic.Util.Logger use-widget-pool final:

Expand Down Expand Up @@ -198,7 +200,7 @@ class Spark.Diagnostic.Util.RemoteMetrics inherits Spark.Diagnostic.Util.Logger
/* Report which endpoint is being access, with verb and payload (if available). */
oLogger:Debug(substitute("Invoking: &1 &2 &3", poHttpMethod:ToString(), pcRequestURI)).
if valid-object(poRequestData) then
oLogger:Trace(substitute("Payload: &1", poRequestData:getJsonText())).
oLogger:Trace(substitute("Invoke Payload: &1 bytes", length(poRequestData:getJsonText(), "raw"))).

/* Set credentials for HTTP basic using the specific realm. */
assign oCredentials = new Credentials(this-object:ManagerRealm,
Expand All @@ -217,7 +219,7 @@ class Spark.Diagnostic.Util.RemoteMetrics inherits Spark.Diagnostic.Util.Logger
oHttpResp = HttpClient:Instance():Execute(oHttpReq).

if oHttpResp:StatusCode ne 200 then do:
oLogger:Error(substitute("Response Code was not HTTP/200: &1", string(oHttpResp:StatusCode))).
oLogger:Error(substitute("Response Code was not HTTP/200: &1", oHttpResp:StatusCode)).
return ?.
end. /* Response not HTTP/200 */

Expand Down
1 change: 1 addition & 0 deletions src/Spark/Diagnostic/metrics_shutdown.p
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ catch err as Progress.Lang.Error:
/* Catch and Release */
message substitute("Metrics Shutdown Error: &1", err:GetMessage(1)).
end catch.

1 change: 1 addition & 0 deletions src/Spark/Diagnostic/metrics_startup.p
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ catch err as Progress.Lang.Error:
/* Catch and Release */
message substitute("Metrics Startup Error: &1", err:GetMessage(1)).
end catch.

2 changes: 1 addition & 1 deletion src/Spark/version.i
Original file line number Diff line number Diff line change
@@ -1 +1 @@
&GLOBAL-DEFINE SPARK_VERSION 4.6.0-2019.08.06.020429 (11.7.4)
&GLOBAL-DEFINE SPARK_VERSION 4.6.1-2019.10.28.021736 (12.1.0)

0 comments on commit 4b4dddd

Please sign in to comment.