-
Notifications
You must be signed in to change notification settings - Fork 13
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
Droth 3297 improve logging #2026
Changes from 6 commits
934ec47
67779a8
8c94762
f27d60b
34fc7fb
e18b0ab
8e92c42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
create table roadlink ( | ||
kmtkid varchar(40), | ||
objectid numeric(38,0), | ||
mtkid numeric(38,0), | ||
drid numeric(38,0), | ||
linkid numeric(38,0), | ||
sourceinfo integer, | ||
adminclass integer, | ||
municipalitycode integer, | ||
mtkgroup integer, | ||
mtkclass numeric(38,0), | ||
roadname_fi varchar(80), | ||
roadname_se varchar(80), | ||
roadname_sm varchar(80), | ||
roadnumber numeric(38,0), | ||
roadpartnumber integer, | ||
surfacetype integer, | ||
constructiontype integer, | ||
directiontype integer, | ||
verticallevel integer, | ||
horizontalaccuracy numeric(38,0), | ||
verticalaccuracy numeric(38,0), | ||
vectortype numeric(5,0), | ||
geometrylength numeric(11,3), | ||
minanleft numeric(38,0), | ||
maxanleft numeric(38,0), | ||
minanright numeric(38,0), | ||
maxanright numeric(38,0), | ||
validfrom timestamp, | ||
created_date timestamp, | ||
created_user varchar(64), | ||
last_edited_date timestamp, | ||
geometry_edited_date timestamp, | ||
validationstatus integer, | ||
updatenumber integer, | ||
objectstatus integer, | ||
subtype integer, | ||
shape geometry(linestringzm,3067), | ||
se_anno_cad_data bytea, | ||
mtkhereflip integer, | ||
from_left numeric(38,0), | ||
to_left numeric(38,0), | ||
from_right numeric(38,0), | ||
to_right numeric(38,0), | ||
startnode numeric(38,0), | ||
endnode numeric(38,0), | ||
constraint roadlink_linkid unique (linkid) deferrable initially deferred, | ||
constraint roadlink_mtkid unique (mtkid) deferrable initially deferred | ||
); | ||
alter table roadlink add primary key (linkid); | ||
|
||
create index roadlink_spatial_index on roadlink using gist (shape); | ||
create index adminclass_index on roadlink (adminclass); | ||
create index constructio_index on roadlink (constructiontype); | ||
create index linkid_index on roadlink (linkid); | ||
create index mtkclass_index on roadlink (mtkclass); | ||
create index mtkid_index on roadlink (mtkid); | ||
create index municipality_index on roadlink (municipalitycode); | ||
create index updatenumbe_index on roadlink (updatenumber); | ||
create index updatenumber_adminclass_municipalitycode_index on roadlink (updatenumber,adminclass,municipalitycode); | ||
create index updatenumbe_adminclass_index on roadlink (updatenumber,adminclass); | ||
create index mtkid_mtkhereflip_index on roadlink (mtkid,mtkhereflip); | ||
create index linkid_mtkc_index on roadlink (linkid,mtkclass); | ||
create index muni_mtkc_index on roadlink (municipalitycode,mtkclass); | ||
create index roadnum_mtkc_index on roadlink (roadnumber,mtkclass); | ||
create index endnode_municipalitycode_index on roadlink (endnode,municipalitycode); | ||
create index startnode_municipalitycode_index on roadlink (startnode,municipalitycode); | ||
|
||
create table roadlinkex ( | ||
objectid numeric(38,0), | ||
drid numeric(38,0), | ||
linkid numeric(38,0), | ||
sourceinfo integer, | ||
adminclass integer, | ||
municipalitycode integer, | ||
mtkgroup integer, | ||
mtkclass numeric(38,0), | ||
roadname_fi varchar(80), | ||
roadname_se varchar(80), | ||
roadname_sm varchar(80), | ||
roadnumber numeric(38,0), | ||
roadpartnumber integer, | ||
surfacetype integer, | ||
constructiontype integer, | ||
directiontype integer, | ||
verticallevel integer, | ||
horizontalaccuracy numeric(38,0), | ||
verticalaccuracy numeric(38,0), | ||
vectortype integer, | ||
geometrylength double precision, | ||
minanleft numeric(38,0), | ||
maxanleft numeric(38,0), | ||
minanright numeric(38,0), | ||
maxanright numeric(38,0), | ||
validfrom timestamp, | ||
created_date timestamp, | ||
created_user varchar(64), | ||
last_edited_date timestamp, | ||
geometry_edited_date timestamp, | ||
validationstatus integer, | ||
feedbackstatus integer, | ||
feedbackinfo varchar(255), | ||
objectstatus integer, | ||
subtype integer, | ||
jobid numeric(38,0), | ||
shape geometry(linestringzm,3067), | ||
se_anno_cad_data bytea, | ||
from_left numeric(38,0), | ||
to_left numeric(38,0), | ||
from_right numeric(38,0), | ||
to_right numeric(38,0), | ||
estimated_completion timestamp, | ||
track_code integer, | ||
cust_class varchar(50), | ||
cust_id_str varchar(50), | ||
cust_id_num numeric(38,0), | ||
cust_owner numeric(38,0), | ||
constraint roadlinkex_linkid unique (linkid) deferrable initially deferred | ||
); | ||
|
||
alter table roadlinkex add primary key (linkid); | ||
|
||
create index roadlinkex_spatial_index on roadlinkex using gist(shape); | ||
create index roadlinkex_adminclass_index on roadlinkex (adminclass); | ||
create index roadlinkex_jobid_index on roadlinkex (jobid); | ||
create index roadlinkex_municipalitycode_index on roadlinkex (municipalitycode); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -462,7 +462,7 @@ class RoadLinkService(val vvhClient: VVHClient, val eventbus: DigiroadEventBus, | |
Await.result(vvhClient.roadLinkChangeInfo.fetchByBoundsAndMunicipalitiesF(bounds, municipalities).zip(vvhClient.roadLinkData.fetchByMunicipalitiesAndBoundsF(bounds, municipalities)), atMost = Duration.Inf) | ||
) | ||
withDynTransaction { | ||
LogUtils.time(logger, "TEST LOG enrichRoadLinksFromVVH")( | ||
LogUtils.time(logger, "TEST LOG enrichRoadLinksFromVVH, link count: " + links.size)( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TEST LOG enrichRoadLinksFromVVH from boundingbox request |
||
(enrichRoadLinksFromVVH(links), changes) | ||
) | ||
} | ||
|
@@ -1340,7 +1340,7 @@ class RoadLinkService(val vvhClient: VVHClient, val eventbus: DigiroadEventBus, | |
|
||
def enrichRoadLinksFromVVH(allVvhRoadLinks: Seq[VVHRoadlink]): Seq[RoadLink] = { | ||
val vvhRoadLinks = allVvhRoadLinks.filterNot(_.featureClass == FeatureClass.WinterRoads) | ||
LogUtils.time(logger,"TEST LOG roadLinkDataByLinkId"){getRoadLinkDataByLinkIds(vvhRoadLinks)} | ||
LogUtils.time(logger,"TEST LOG roadLinkDataByLinkId, link count: " + vvhRoadLinks.size){getRoadLinkDataByLinkIds(vvhRoadLinks)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TEST LOG roadLinkDataByLinkId -> TEST LOG enrich roadLinkDataByLinkId vaikkapa |
||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import fi.liikennevirasto.digiroad2.postgis.PostGISDatabase | |
import fi.liikennevirasto.digiroad2.process.AssetValidatorInfo | ||
import fi.liikennevirasto.digiroad2.service.RoadLinkService | ||
import fi.liikennevirasto.digiroad2.service.pointasset.TrafficSignInfo | ||
import fi.liikennevirasto.digiroad2.util.LogUtils | ||
import fi.liikennevirasto.digiroad2.{DigiroadEventBus, GeometryUtils, Point, _} | ||
import org.joda.time.DateTime | ||
import org.slf4j.LoggerFactory | ||
|
@@ -64,8 +65,12 @@ class ManoeuvreService(roadLinkService: RoadLinkService, eventBus: DigiroadEvent | |
} | ||
|
||
def getByBoundingBox(bounds: BoundingRectangle, municipalities: Set[Int]): Seq[Manoeuvre] = { | ||
val roadLinks = roadLinkService.getRoadLinksFromVVH(bounds) | ||
getByRoadLinks(roadLinks) | ||
val roadLinks = LogUtils.time(logger, "TEST LOG manoeuvres get roadlinks by bbox") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. varmaan yhtenäisempää käyttää boundingbox sanaa kuin bbox, helpottaa filterointia kun vaan yksi formaatti |
||
roadLinkService.getRoadLinksFromVVH(bounds) | ||
} | ||
LogUtils.time(logger, "TEST LOG manoeuvres get assets by roadlinks, roadlink count: " + roadLinks.size) { | ||
getByRoadLinks(roadLinks) | ||
} | ||
} | ||
|
||
def updateManoeuvre(userName: String, oldManoeuvreId: Long, manoeuvreUpdates: ManoeuvreUpdates, modifiedDate: Option[DateTime]): Long = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kannattaako nyt tätä operaatiota oikein logitaa, ei taida olla hirveen oleelinen samoin toi validate boudingbox mut ei tää nyt varmaan haitta.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lähinnä menin sillä periaatteella, että "ei jätetä mitään kiveä kääntämättä". Todennäköisesti turhaa lokittaa tätä mutta ei haittaakaan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
joo eipä se pahaa tee