Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Logging about page cache warmup start and completion.
Add info log messages about page cache warmer start and completion. Also, include a number of loaded pages and duration into completion message.
- Loading branch information
1 parent
d54bc35
commit fc5186f
Showing
9 changed files
with
163 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
.../src/main/java/org/neo4j/kernel/impl/pagecache/monitor/PageCacheWarmerLoggingMonitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (c) 2002-2018 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j Enterprise Edition. The included source | ||
* code can be redistributed and/or modified under the terms of the | ||
* GNU AFFERO GENERAL PUBLIC LICENSE Version 3 | ||
* (http://www.fsf.org/licensing/licenses/agpl-3.0.html) with the | ||
* Commons Clause, as found in the associated LICENSE.txt file. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* Neo4j object code can be licensed independently from the source | ||
* under separate terms from the AGPL. Inquiries can be directed to: | ||
* licensing@neo4j.com | ||
* | ||
* More information is also available at: | ||
* https://neo4j.com/licensing/ | ||
*/ | ||
package org.neo4j.kernel.impl.pagecache.monitor; | ||
|
||
import org.neo4j.logging.Log; | ||
|
||
import static java.lang.System.currentTimeMillis; | ||
import static org.neo4j.helpers.Format.duration; | ||
|
||
public class PageCacheWarmerLoggingMonitor extends PageCacheWarmerMonitorAdapter | ||
{ | ||
private final Log log; | ||
private long warmupStartMillis; | ||
|
||
public PageCacheWarmerLoggingMonitor( Log log ) | ||
{ | ||
this.log = log; | ||
} | ||
|
||
@Override | ||
public void warmupStarted() | ||
{ | ||
warmupStartMillis = currentTimeMillis(); | ||
log.info( "Page cache warmup started." ); | ||
} | ||
|
||
@Override | ||
public void warmupCompleted( long pagesLoaded ) | ||
{ | ||
log.info( "Page cache warmup completed. %d pages loaded. Duration: %s.", pagesLoaded, getDuration( warmupStartMillis ) ); | ||
} | ||
|
||
private static String getDuration( long startTimeMillis ) | ||
{ | ||
return duration( currentTimeMillis() - startTimeMillis ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
.../src/main/java/org/neo4j/kernel/impl/pagecache/monitor/PageCacheWarmerMonitorAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) 2002-2018 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j Enterprise Edition. The included source | ||
* code can be redistributed and/or modified under the terms of the | ||
* GNU AFFERO GENERAL PUBLIC LICENSE Version 3 | ||
* (http://www.fsf.org/licensing/licenses/agpl-3.0.html) with the | ||
* Commons Clause, as found in the associated LICENSE.txt file. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* Neo4j object code can be licensed independently from the source | ||
* under separate terms from the AGPL. Inquiries can be directed to: | ||
* licensing@neo4j.com | ||
* | ||
* More information is also available at: | ||
* https://neo4j.com/licensing/ | ||
*/ | ||
package org.neo4j.kernel.impl.pagecache.monitor; | ||
|
||
public class PageCacheWarmerMonitorAdapter implements PageCacheWarmerMonitor | ||
{ | ||
@Override | ||
public void warmupStarted() | ||
{ | ||
//nothing | ||
} | ||
|
||
@Override | ||
public void warmupCompleted( long pagesLoaded ) | ||
{ | ||
//nothing | ||
} | ||
|
||
@Override | ||
public void profileCompleted( long pagesInMemory ) | ||
{ | ||
//nothing | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters