-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix performance problem at login #464
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
650ea07
enhancement (webapi): Add profiling to investigate #443.
e418f2c
style (webapi): Add missing method call parentheses.
0a239e2
test: Read large expected response from a file instead of including i…
7719733
fix (webapi): Fix performance problem in ProjectsResponderV1 (#443)
9a9ab91
refactor (webapi): Clean up code for pull request.
df80438
Merge branch 'develop' into wip/performance-debugging
cc1de5b
style (webapi): Reformat comment.
524b41f
fix (webapi): Set profile-queries to false by default.
56bde7d
fix (webapi): Comment out another use of MessageUtil.toSource().
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,15 +29,15 @@ object Main extends App with LiveCore with KnoraService { | |
//Kamon.start() | ||
|
||
/* Check and wait until all actors are running */ | ||
checkActorSystem | ||
checkActorSystem() | ||
|
||
val arglist = args.toList | ||
|
||
if (arglist.contains("loadDemoData")) StartupFlags.loadDemoData send true | ||
if (arglist.contains("allowResetTriplestoreContentOperationOverHTTP")) StartupFlags.allowResetTriplestoreContentOperationOverHTTP send true | ||
|
||
/* Start the HTTP layer, allowing access */ | ||
startService | ||
startService() | ||
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. see above 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. Yes. |
||
|
||
sys.addShutdownHook(stopService) | ||
} |
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
192 changes: 89 additions & 103 deletions
192
webapi/src/main/scala/org/knora/webapi/responders/v1/PermissionsResponderV1.scala
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
52 changes: 52 additions & 0 deletions
52
webapi/src/main/scala/org/knora/webapi/util/FileUtil.scala
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,52 @@ | ||
/* | ||
* Copyright © 2015 Lukas Rosenthaler, Benjamin Geer, Ivan Subotic, | ||
* Tobias Schweizer, André Kilchenmann, and Sepideh Alassi. | ||
* | ||
* This file is part of Knora. | ||
* | ||
* Knora is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Knora 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. | ||
* | ||
* You should have received a copy of the GNU Affero General Public | ||
* License along with Knora. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.knora.webapi.util | ||
|
||
import java.io.File | ||
import java.nio.charset.StandardCharsets | ||
import java.nio.file.{Files, Paths} | ||
|
||
import scala.io.{Codec, Source} | ||
|
||
/** | ||
* Functions for reading and writing files. | ||
*/ | ||
object FileUtil { | ||
/** | ||
* Writes a string to a file. | ||
* | ||
* @param file the destination file. | ||
* @param content the string to write. | ||
*/ | ||
def writeFile(file: File, content: String): Unit = { | ||
Files.write(Paths.get(file.getCanonicalPath), content.getBytes(StandardCharsets.UTF_8)) | ||
} | ||
|
||
/** | ||
* Reads a file into a string. | ||
* | ||
* @param file the source file. | ||
* @return the contents of the file. | ||
*/ | ||
def readFile(file: File): String = { | ||
Source.fromFile(file)(Codec.UTF8).mkString | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Did you do that because the method has side-effects? http://docs.scala-lang.org/style/method-invocation.html
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.
Yes.
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.
IntelliJ pointed it out as a style recommendation.