Skip to content

Commit

Permalink
Scala Common Enrich: renamed dvce_tstamp to dvce_created_tstamp (closes
Browse files Browse the repository at this point in the history
  • Loading branch information
fblundun committed Sep 3, 2015
1 parent 7131fea commit b9a4104
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ object EnrichmentManager {
("fp" , (ME.toTsvSafe, "user_fingerprint")),
("vid" , (CU.stringToJInteger, "domain_sessionidx")),
("sid" , (CU.validateUuid, "domain_sessionid")),
("dtm" , (EE.extractTimestamp, "dvce_tstamp")),
("dtm" , (EE.extractTimestamp, "dvce_created_tstamp")),
("ttm" , (EE.extractTimestamp, "true_tstamp")),
("stm" , (EE.extractTimestamp, "dvce_sent_tstamp")),
("tna" , (ME.toTsvSafe, "name_tracker")),
Expand Down Expand Up @@ -432,7 +432,7 @@ object EnrichmentManager {
case null =>
EE.getDerivedTimestamp(
Option(event.dvce_sent_tstamp),
Option(event.dvce_tstamp),
Option(event.dvce_created_tstamp),
Option(event.collector_tstamp)
) match {
case Success(dt) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class EnrichedEvent {
// Date/time
@BeanProperty var etl_tstamp: String = _
@BeanProperty var collector_tstamp: String = _
@BeanProperty var dvce_tstamp: String = _
@BeanProperty var dvce_created_tstamp: String = _

// Transaction (i.e. this logging event)
@BeanProperty var event: String = _
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ class DerivedTimestampSpec extends Specification with DataTables with Validation
"getDerivedTimestamp should correctly calculate the derived timestamp " ! e1^
end
def e1 =
"SPEC NAME" || "DVCE_SENT_TSTAMP" | "DVCE_TSTAMP" | "COLLECTOR_TSTAMP" | "EXPECTED DERIVED_TSTAMP" |
"No dvce_sent_tstamp" !! null ! "2014-04-29 12:00:54.555" ! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:54.000" |
"No dvce_tstamp" !! null ! null ! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:54.000" |
"No collector_tstamp" !! null ! null ! null ! null |
"dvce_sent_tstamp before dvce_tstamp" !! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:54.001" ! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:54.000" |
"dvce_sent_tstamp after dvce_tstamp" !! "2014-04-29 09:00:54.001" ! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:53.999" |> {
"SPEC NAME" || "DVCE_SENT_TSTAMP" | "DVCE_CREATED_TSTAMP" | "COLLECTOR_TSTAMP" | "EXPECTED DERIVED_TSTAMP" |
"No dvce_sent_tstamp" !! null ! "2014-04-29 12:00:54.555" ! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:54.000" |
"No dvce_created_tstamp" !! null ! null ! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:54.000" |
"No collector_tstamp" !! null ! null ! null ! null |
"dvce_sent_tstamp before dvce_created_tstamp" !! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:54.001" ! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:54.000" |
"dvce_sent_tstamp after dvce_created_tstamp" !! "2014-04-29 09:00:54.001" ! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:54.000" ! "2014-04-29 09:00:53.999" |> {

(_, sent, created, collected, expected) => EventEnrichments.getDerivedTimestamp(Option(sent), Option(created), Option(collected)) must beSuccessful(Option(expected))
}
Expand Down

0 comments on commit b9a4104

Please sign in to comment.