Commit Graph

383 Commits

Author SHA1 Message Date
Moritz Kiefer
ebb8fab97e
Add a ContractDao benchmark for payload queries (#10426)
This adds a very dumb benchmark which queries for equality on a single
int field.

changelog_begin
changelog_end
2021-07-27 15:50:22 +00:00
akshayshirahatti-da
b976c9cf4c
Disable autocommit for hikariCP for http-json-api db conn (#10427)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-27 16:42:43 +01:00
Victor Peter Rouven Müller
fc305e6c2e
[JSON-API] Shutdown on startup if the db connection is invalid (#10360)
* [JSON-API] Shutdown on startup if the db connection is invalid

changelog_begin

- [JSON-API] The json api now correctly shutdowns at startup if the provided db connection is invalid in case of `createSchema=false`

changelog_end

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/Main.scala

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-07-27 14:26:15 +02:00
akshayshirahatti-da
4b55f1ab6a
Connection pool for Contract Dao (#10359)
* Switch ContractDao to use a HikariCP connection pool
CHANGELOG_BEGIN
CHANGELOG_END

* missed conn pool changes for PostgresTest and ContractDaoBenchmark

* shutdown db access await threadpool and fix formatting

* custom pool sizes for Prod and Integration similar to DbTriggerDao

* cleanup contract dao connection pool

* simplify Dao shutdown

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* remove redundant config setting

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* fix code formatting issue, NonUnitStatments warning
2021-07-27 09:15:39 +01:00
Remy
72cf2f36d3
LF: replace bazel keyword stable by default (#10410)
to refer to the compiler default LF output.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-27 09:27:03 +02:00
Stephen Compall
221d0a0689
use doobie 0.9.0 Fragment-in-Fragment interpolation in json-api db-backend (#10399)
* use doobie 0.9.0 Fragment-in-Fragment interpolation in json-api db-backend

Since tpolecat/doobie#1045 (and therefore 4ca02e0eb6) doobie has
supported interpolating fragments in fragments.  We've used this feature
for several fragments written since #7618, but have left the ones
written before alone to use ++.  Here we change that where it
meaningfully clarifies the SQL subexpression.

Note that this does not entail a Put or Write instance for Fragment.
You cannot abstract over Fragment and arbitrary interpolated data in
this way, because Fragments are not treated as positional parameters;
that would mean being able to put arbitrary SQL substrings in positional
parameters.

CHANGELOG_BEGIN
CHANGELOG_END

* scalafmt

* useless whitespace accidentally removed
2021-07-23 19:42:06 +00:00
Stephen Compall
17709b5ba3
use a single SQL query for any number of json-api query pairs (#10344)
* new projection for aggregated matched-queries

We can redo all the template-ID matches (and payload query matches, if
needed) in the SELECT projection clause to emit a list of matchedQueries
indices SQL-side.

CHANGELOG_BEGIN
CHANGELOG_END

* selectContractsMultiTemplate always returns one query

* factoring

* remove multiquery deduplication from ContractDao

* test simplest case of projectedIndex; remove uniqueSets tests

* remove uniqueSets

* add more test cases for the 3 main varieties of potential inputs

* remove uniqueSets tests that were commented for reference

* remove unneeded left-join

* scala 2.12 port

* port Map test order to 2.12

* use SortedMap so the Scala version tests are unified

- suggested by @cocreature; thanks
2021-07-23 17:13:55 +00:00
Stephen Compall
91529ee43d
clear up record specifications in http-json integration tests (#10366)
* clean up record specifications in http-json test payloads

* other records

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-22 15:20:30 +00:00
Moritz Kiefer
9c9b91eca7
Support deletion of a large number of contracts (#10353)
* Support deletion of a large number of contracts

fixes #10339

There are two orthogonal issues here:

1. scalaz’s toVector from the Foldable[Set] instance
   stackoverflows. I’ve just avoided using that altogether.
2. Oracle doesn’t like more than 1k items in the IN clause. I chunked
   the queries into chunks of size 1k to fix this.

changelog_begin

- [JSON API] Fix an error where transactions that delete a large
  number of contracts resulted in stackoverflows with the PostgreSQL
  backend and database errors with Oracle.

changelog_end

* fix benchmark

changelog_begin
changelog_end

* Update ledger-service/db-backend/src/main/scala/com/digitalasset/http/dbbackend/Queries.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* Update ledger-service/db-backend/src/main/scala/com/digitalasset/http/dbbackend/Queries.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* that's not how you foldA

changelog_begin
changelog_end

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-07-22 06:47:26 +00:00
Moritz Kiefer
1b5f99e051
Stop printing stacktrace on logging setup failures (#10364)
Printing stacktraces is consider an antipattern by some people and
gets flagged by VeraCode. While this shouldn’t actually be an issue
here, it is also not super useful so dropping it is easier than
arguing that this is a false positive.

changelog_begin
changelog_end
2021-07-22 05:25:02 +00:00
Moritz Kiefer
68dcda0f29
Drop unused textType from JSON API Oracle queries (#10356)
Got slightly confused by the arbitrary 100 character limit but luckily
this isn’t actually used anywhere.

changelog_begin
changelog_end
2021-07-21 18:43:46 +02:00
Victor Peter Rouven Müller
8148137259
[JSON-API] Include the logging context in the ledger client for consistent logging (#10332)
changelog_begin

- [JSON-API] Connection tries from the json api to the ledger now include the logging context, more specifically the instance_uuid is included in each logging statement.

changelog_end
2021-07-21 10:05:45 +02:00
Moritz Kiefer
b7cf42d173
Upgrade doobie to version 0.13.4 (#10326)
Was curious if there were any relevant performance improvements in
newer versions. Looks like the answer is no but we might as well
upgrade anyway.

changelog_begin
changelog_end
2021-07-20 19:19:11 +02:00
Samir Talwar
c3bc26fd1c
daml-lf/data: Move ID aliases to Ref from _ledger-api-common_. [KVL-1002] (#10323)
* daml-lf/data: Move ID aliases to `Ref` from _ledger-api-common_.

This allows us to remove a lot of dependencies on _ledger-api-common_,
and use these aliases in other places where that module is not used.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Remove an unused import.

* http-json-oracle: Remove `ledger-api-common` as a dependency.

* bindings-rxjava: Remove a now-unused dependency.
2021-07-20 11:01:19 +00:00
Moritz Kiefer
504c231732
Use a combined template id, stakeholder index (#10315)
* Use a combined template id, stakeholder index

fixes #10231

Before

Benchmark (batchSize) (extraParties) (extraTemplates) Mode Cnt Score Error Units
QueryBenchmark.run 10000 0 1 avgt 5 0.277 ± 0.037 s/op
QueryBenchmark.run 10000 0 10 avgt 5 0.479 ± 0.301 s/op
QueryBenchmark.run 10000 0 100 avgt 5 2.131 ± 0.497 s/op

After

Benchmark           (batchSize)  (extraParties)  (extraTemplates)  Mode  Cnt  Score   Error  Units
QueryBenchmark.run        10000               1                 0  avgt    5  0.274 ± 0.141   s/op
QueryBenchmark.run        10000              10                 0  avgt    5  0.299 ± 0.144   s/op
QueryBenchmark.run        10000             100                 0  avgt    5  0.281 ± 0.038   s/op

changelog_begin
changelog_end

* more disambiguation

changelog_begin
changelog_end

* Update ledger-service/db-backend/src/main/scala/com/digitalasset/http/dbbackend/Queries.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-07-20 08:41:45 +02:00
Remy
159728d716
LF: use Either by default in all archive reader API (#10295)
This is a follow up of #10277.
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-19 19:48:37 +02:00
Victor Peter Rouven Müller
80b65f6def
[DOCS] Add documentation for the JSON API metrics (#10312)
* [DOCS] Add documentation for the JSON API metrics

changelog_begin

- [JSON-API] You can now find a section `Metrics` in the http-json api documentation explaining how to enable metrics and which are available

changelog_end

* Fix rst build warnings

* Update docs/source/json-api/metrics.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Adapt metrics doc to state that it IS an exhaustive list and remove wrong copy pasta text & add info about prometheus

* Update the legal values for the metrics reporter cli option

* shorten the description, the change prior was unnecessary ._.

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-07-19 17:32:23 +02:00
Victor Peter Rouven Müller
6abb903a7f
[JSON-API] Put the request & response bodies into the log ctx if the log level is debug (for specific statements) (#10298)
* [JSON-API] Log json request & response bodies in debug

This also readds logging of incoming requests and the responses which are being send out.

changelog_begin

- [JSON-API] Logging of the request and response bodies are now available for appropriate requests if the chosen log level is equal or lower than DEBUG. These can then be found in the logging context of the request begin & end log messages (The field names in the ctx are "request_body" and "response_body").

changelog_end

* Move the http request throughput marking to the right place including the logging of the processing time

* Ensure that the processing time measuring is implemented consistent
2021-07-19 14:52:23 +00:00
Samir Talwar
bd12170af2
participant-state: Remove the ParticipantId, PackageId, and Party aliases. [KVL-1002] (#10308)
* participant-state: Remove the `ParticipantId` alias.

This alias adds nothing. By using `Ref.ParticipantId` directly, many
packages can remove their dependency on the _participant-state_ package.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-state: Remove the `PackageId` and `Party` aliases.

They don't add anything. Let's just use `Ref`.

* kvutils: Restore missing compat imports.
2021-07-19 12:31:25 +00:00
Moritz Kiefer
fed44970ae
Extend JSON API ContractDao query bench’s with different tpids (#10309)
This PR extends the test to test a full matrix of different party &
template id numbers. Summarizing the results, as expected we index by
party but not by template id:

Benchmark           (batchSize)  (extraParties)  (extraTemplates)  Mode  Cnt  Score   Error  Units
QueryBenchmark.run        10000               1                 0  avgt    5  0.255 ± 0.064   s/op
QueryBenchmark.run        10000              10                 0  avgt    5  0.304 ± 0.245   s/op
QueryBenchmark.run        10000             100                 0 avgt    5  0.296 ± 0.064   s/op

Benchmark           (batchSize)  (extraParties)  (extraTemplates)  Mode  Cnt  Score   Error  Units
QueryBenchmark.run        10000               0                 1  avgt    5  0.277 ± 0.037   s/op
QueryBenchmark.run        10000               0                10  avgt    5  0.479 ± 0.301   s/op
QueryBenchmark.run        10000               0               100  avgt    5  2.131 ± 0.497   s/op

We know how to fix that so I’ll get on that.

changelog_begin
changelog_end
2021-07-19 13:57:43 +02:00
Miklos
0eba812109
Remove trace_context field from Ledger API [KVL-1021] (#10256)
CHANGELOG_BEGIN
* [Integration Kit] Removed trace_context field from Ledger API and its bindings as we now have trace context propagation support via gRPC metadata. If you are constructing or consuming Ledger API requests or responses directly, you may need to update your code.
CHANGELOG_END
2021-07-15 19:06:25 +02:00
Moritz Kiefer
53822537e4
Refresh json API materialized view on statement (#10285)
I haven’t found any conclusive information as to why ON COMMIT doesn’t
work incrementally but
https://docs.oracle.com/en/database/oracle/oracle-database/19/adjsn/json-query-rewrite-use-materialized-view-json_table.html#GUID-8B0922ED-C0D1-45BD-9588-B7719BE4ECF0
recommends that for rewriting (which isn’t what we do here but both
involve a materialized view on json_table).

Benchmarks:

before:
InsertBenchmark.run         1000          1            1000  avgt    5  0.327 ± 0.040   s/op
InsertBenchmark.run         1000          3            1000  avgt    5  0.656 ± 0.043   s/op
InsertBenchmark.run         1000          5            1000  avgt    5  1.034 ± 0.051   s/op
InsertBenchmark.run         1000          7            1000  avgt    5  1.416 ± 0.106   s/op
InsertBenchmark.run         1000          9            1000  avgt    5  1.734 ± 0.143   s/op
QueryBenchmark.run          1000         10             N/A  avgt    5  0.071 ± 0.016   s/op

After:
Benchmark            (batchSize)  (batches)  (numContracts)  Mode  Cnt  Score   Error  Units
InsertBenchmark.run         1000          1            1000  avgt    5  0.217 ± 0.034   s/op
InsertBenchmark.run         1000          3            1000  avgt    5  0.232 ± 0.027   s/op
InsertBenchmark.run         1000          5            1000  avgt    5  0.226 ± 0.051   s/op
InsertBenchmark.run         1000          7            1000  avgt    5  0.225 ± 0.048   s/op
InsertBenchmark.run         1000          9            1000  avgt    5  0.232 ± 0.021   s/op
QueryBenchmark.run          1000         10             N/A  avgt    5 0.080 ± 0.014   s/op

The difference in query times is just noise and changes across runs.

So we get the expected behavior of inserts being independent of the
total ACS size now. We could still explore if we gain something by
avoiding the materialized view to reduce constant factors but that’s
much less of an issue.

fixes #10243

changelog_begin
changelog_end
2021-07-15 11:24:42 +00:00
Remy
a8f190214c
LF: change type from Try to Either in archive module (#10277)
* LF: change type from Try to Either in archive module

This is the first part of restructuring errors in archive module.
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* remove type alias

* apply stephen suggestion

* fix after rebase

* fix test

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-07-14 19:24:31 +00:00
Victor Peter Rouven Müller
42c487ba96
[JSON-API] Refactor Endpoints.scala to use path directives etc. (#10274)
* [JSON-API] Refactor Endpoints.scala to use path directives etc.

changelog_begin
changelog_end

* Don't warn that the ev param in toRoute is not used

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/Endpoints.scala

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/Endpoints.scala

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/Endpoints.scala

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Remove weird stuff to have nice stuff with the toRoute function

* Rename the toRoute function & remove comments as things are now clarified

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-07-14 12:35:21 +00:00
Moritz Kiefer
44204bb932
Add a benchmark for contract insertion in the JSON API (#10272)
* Add a benchmark for contract insertion in the JSON API

Unfortunately the results seem to match up with my initial benchmark
in #10234

Benchmark            (batchSize)  (batches)  (numContracts)  Mode  Cnt     Score     Error  Units
InsertBenchmark.run         1000          1            1000  avgt    5   336.674 ±  42.058  ms/op
InsertBenchmark.run         1000          3            1000  avgt    5   787.086 ± 223.018  ms/op
InsertBenchmark.run         1000          5            1000  avgt    5  1181.041 ± 317.017  ms/op
InsertBenchmark.run         1000          7            1000  avgt    5  1531.185 ± 341.060  ms/op
InsertBenchmark.run         1000          9            1000  avgt    5  1945.345 ± 436.352  ms/op

Score should ideally be more or less constant but it goes up very
significantly as the total ACS size changes

fixes #10245

changelog_begin
changelog_end

* throughput -> average time

changelog_begin
changelog_end
2021-07-14 13:00:26 +02:00
Remy
caf85a2270
LF: rationalize archive Parser/Reader/Decoder (#10239)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-14 11:05:17 +02:00
Moritz Kiefer
0043b81f00
Add a ContractDao benchmark (#10259)
* Add a ContractDao benchmark

This PR adds a simple benchmark that uses the ContractDao directly and
is therefore a bit more fine-grained and easier to analyze than the
gatling benchmarks. I expect we’ll want to extend this, this really
only tests queries on reasonably large size ACS filtered by party but
let’s start somewhere.

fixes #10247

changelog_begin
changelog_end

* Factorize

changelog_begin
changelog_end
2021-07-14 11:02:32 +02:00
Samir Talwar
6c63f96ba9
participant-integration-api: Move SeedService here. (#10261)
I don't see a reason why it's part of the participant state API, and
it definitely doesn't need to change between v1 and v2.

CHANGELOG_BEGIN
- [Integration Kit] The class ``SeedService`` has been moved from the
  *participant-state* Maven package to the *participant-integration-api*
  Maven package, under the Java package name
  ``com.daml.platform.apiserver`` to reflect its usage by the API
  server, not the participant state API. If you use this class directly,
  you will need to change your imports.
CHANGELOG_END
2021-07-14 08:35:29 +00:00
Victor Peter Rouven Müller
0a7f2b1a1b
[JSON-API] Small refactoring to start using akka http routes internally (#10252)
* [JSON-API] Small refactoring to start using akka http routes internally

changelog_begin
changelog_end

* Fix build error

* Explicitly use the immutable seq via additional import

* Fix tests

* Fix scala 2.12 build
2021-07-13 14:07:03 +00:00
Remy
e4d7cd764a
LF: Deprecate com.daml.lf.data.TryOps.Bracket (#10249)
* LF: Deprecate com.daml.lf.data.TryOps.Bracket

CHANGELOG_BEGIN
CHANGELOG_END

* address reviews

* fix
2021-07-13 10:16:53 +00:00
Victor Peter Rouven Müller
b59f36591d
[JSON-API] Correctly extract the request source URL/IP (#10244)
* [JSON-API] Correctly extract the request source URL/IP

changelog_begin
- [JSON-API] If the service is put behind a proxy filling either of these headers X-Forwarded-For & X-Real-Ip then these will now be respected for logging the request source ip/url
changelog_end

* Return to the simple http server start code

* Remove unused import

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/Endpoints.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-07-13 08:33:40 +00:00
Remy
f19f5b0821
LF: Simplify DarReader (#10217)
This PR simplifies a bit DarReader and UniversalDarReader

This is a follow up of #10208.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-08 17:03:45 +02:00
Remy
41b8448b17
LF: Simplify archive reader. (#10208)
* LF: Simplify archive reader.

- decouple Reader and Decoder
- introduce case class to handle hash, proto payload, and version

CHANGELOG_BEGIN
CHANGELOG_END

* Address Moritz' review

* cosmetic
2021-07-07 19:56:40 +00:00
Moritz Kiefer
5f35380a21
Unhide JSON API metrics (#10177)
These were originally hidden in the first PR because the metrics were
very shaky. Now they are actually useful and mentioned in release
notes so hiding this option makes no sense.

changelog_begin
changelog_end
2021-07-05 13:25:00 +00:00
Stefano Baghino
83bc6ae921
Expect a conflated Txn when streaming out the ACS block (#10168)
Fixes #10161

changelog_begin
[JSON API] Fixed a bug that could sporadically make the streaming query
           endpoint crash. This bug only affected 1.15.x snapshot releases.
changelog_end
2021-07-05 10:42:55 +02:00
Samir Talwar
888f02aa4d
ledger-api-common: There's only one way to order absolute offsets. (#10153)
Let's not mess around with injectable orderings.

This has the pleasant side effect of removing dependencies.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-30 14:17:59 +00:00
Samir Talwar
c929a14486
logging-entries: Split from contextualized-logging. [KVL-996] (#10149)
* logging-entries: Split from contextualized-logging.

This allows us to introduce it to Daml-LF without bringing in the
Logback, Logstash, and gRPC dependencies.

CHANGELOG_BEGIN
CHANGELOG_END

* logging-entries: Fix dependencies for 2.12.

* logging-entries: Missed one more Scala 2.12 dependency.

* release: Publish logging-entries.
2021-06-30 12:08:33 +00:00
Victor Peter Rouven Müller
7521ec9988
[JSON-API] Include contract id in the logging ctx when logging exercise commands (#10131)
changelog_begin

- [JSON-API] The contract id is now also included in the logging ctx when logging exercise commands

changelog_end
2021-06-28 09:12:40 +00:00
Samir Talwar
af9382ce92
contextualized-logging: Reduce the API surface and avoid name collisions. (#10102)
* contextualized-logging: Remove `Map` from the `LoggingContextOf` API.

* contextualized-logging: Encapsulate entries.

CHANGELOG_BEGIN
CHANGELOG_END

* contextualized-logging: Disambiguate `withEnrichedLoggingContext`.

So forthcoming implicit conversions won't confuse the compiler.

* contextualized-logging: Remove a now-unused compat import.

* contextualized-logging: Avoid overloading `LoggingEntries#apply`.

* contextualized-logging: Remove the silencer plugin.
2021-06-24 16:21:26 +00:00
Stephen Compall
01d6770450
json-api perf tests: combine large-ACS frequencies combinatorially instead of in lockstep (#10101)
In #10016, 1% template ID and 1% party-set membership meant _the same_ 1%,
meaning that an index of both couldn't possibly yield interesting results.  This
changes how LargeAcs builds the large ACS so that it's "1% of 1%", as you'd
expect.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-24 10:00:02 -04:00
Victor Peter Rouven Müller
1f5aa4491c
[JSON-API] Add metrics for ledger command submission timing (#10076)
changelog_begin

- [JSON-API] Timing metrics which measure how long the processing of a command submission request takes on the ledger are now available

changelog_end
2021-06-22 15:59:23 +00:00
Victor Peter Rouven Müller
0391f3529f
[JSON-API] Add db metrics & response construction metrics (#10068)
changelog_begin

- [JSON-API] The database operations (regardless of in-memory or postgres) contain now metrics for fetching contracts by id or key (seperate metrics foreach)
- [JSON-API] The time for a repsonse payload construction of a request is now also tracked in a metric

changelog_end
2021-06-22 10:34:29 +02:00
Stefano Baghino
b796695768
Add per-query offsets to HTTP-JSON API (#9847)
* Add per-query offsets to HTTP-JSON API

changelog_begin
[HTTP/JSON API] The streaming query endpoint now accepts to override the
offset for each query using the `offset` field. You can read more
about it on the documentation.
changelog_end

* Replace mapValues and filterKeys with something that compiles with both 2.12 and 2.13

* Refactor offset comparison

- Addresses https://github.com/digital-asset/daml/pull/9847/files#r642363229
- Addresses https://github.com/digital-asset/daml/pull/9847/files#r642363848

* Add tests (failing), fix definition of starting offset

* Fix failing test

* More tests

* Add tests for verify older behavior still works

* Fix regression

* Remove debug prints

- Addresses https://github.com/digital-asset/daml/pull/9847#discussion_r642362683
- Addresses https://github.com/digital-asset/daml/pull/9847#discussion_r642362774

* Failed attempt at ACS call integration

* Revert "Failed attempt at ACS call integration"

This reverts commit 879e0cfbdb579362674120f93a9c93388ed81bc1.

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r647019447

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r647019965

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r647020825

* Integrate with ACS calls

* Fix three broken tests

* Fix one regression

* Fix last regression

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651586811

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651668995

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651669134

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651669691

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651670134

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651676902

* Fix Scala 2.12 compilation error

* Fix compilation issues on Scala 2.13 and 2.12

* Remove unnecessary dependency

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651824658

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651831880

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651833646

* Address two comments:

- https://github.com/digital-asset/daml/pull/9847#discussion_r651841615
- https://github.com/digital-asset/daml/pull/9847#discussion_r651842951

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651838831

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651949821

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r651943962

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r652492756

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r652537652

* query_offset -> queryOffset

* Document per-query offsets

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r655117581

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r655119961

* Apply suggestions from code review

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r655233517

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r655266806

* Address https://github.com/digital-asset/daml/pull/9847#discussion_r655265717

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-06-21 16:38:07 +02:00
Victor Peter Rouven Müller
e4585295c6
[JSON-API] Add moar timing metrics (#10045)
* [JSON-API] Add more timing metrics

changelog_begin

- [JSON-API] Timing metrics are now available for party management, package management, command submission and query endpoints.
- [JSON-API] Also added a timing metric for parsing and decoding of incoming json payloads

changelog_end

* Add comments to new metrics

* Split metrics up more & remove obsolete metric

* Split up timers for query endpoints
2021-06-21 14:37:36 +00:00
Gary Verhaegen
e12a449c81
s/DABL/Daml Hub/ (#10062)
It's been long enough.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-21 16:37:17 +02:00
Stephen Compall
3113702dc0
index json-api signatories and observers on Oracle (#9895)
* nvarchar2 keys are text-incompatible, but varchar2 keys are fine

* commit the ACS update before query

* add changelog

CHANGELOG_BEGIN
- [JSON API] The Oracle database schema has changed; if using
  ``--query-store-jdbc-config``, you must rebuild the database by adding
  ``,createSchema=true``.  See #9895.
CHANGELOG_END

* expand the InitDdl set to include materialized views

* replace search index with a materialized view that expands the stakeholders

* allow materialized views to be created in Oracle testing

* join and query the contract_stakeholders table for party-set membership

- restoring a few elements removed by 3e6661128d (#9484)
2021-06-17 11:52:37 -04:00
Stephen Compall
7dfa36fccd
pass supportedJdbcDriverNames implicitly, and only to what actually needs it (#10036)
This solves two warts in the code:

- the validate/createUnsafe double-parse, because scopt doesn't let you flatMap;
- the non-JdbcConfig sub-configs appeared to need to know the JDBC drivers when
  they really don't, because of a quirk in the inherited implementation

That coherence of scopt.Read instances calls for all its dependencies to be
coherent leads us to treat supportedJdbcDriverNames as a nullary typeclass
instance.  This is a nullary typeclass by the same justification as
SupportedJdbcDriver; see scaladoc there for more.

And we solve the latter problem by...adding a type parameter, how else.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-17 10:40:49 -04:00
Victor Peter Rouven Müller
1852830833
[JSON-API] Concurrent query etc. metrics (#10031)
* [JSON-API] Concurrent query etc. metrics

changelog_begin

- [JSON-API] The metrics which describe the amount of these concurrent events is now available:
	- running http request
	- command submissions
	- package allocations
	- party allocations

changelog_end

* Rename running metrics to throughput ones & add comments on the metrics

* Adjust names of other existing metrics too, to have for the json api a more consistent metrics naming
2021-06-16 17:08:06 +00:00
Stephen Compall
321c4da2dd
test different template-ID frequencies in the "mega" perf scenario (#10016)
* add a new template for testing template-ID-sensitive query

* add a tpid *and* party-set 1% scenario

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-16 12:19:03 -04:00
Victor Peter Rouven Müller
cfee5a2d8b
[JSON-API] Add information from the jwtpayload to the logging context (#9995)
* Add information from the jwtpayload to the logging context

changelog_begin

- [JSON API] For applicable requests actAs, readAs, applicationId & ledgerId are included in the log context

changelog_end

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/Endpoints.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/Endpoints.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* Revert changes to make the function generic

* Create JwtPayloadG trait from which both payload variants inherit

* Reduce code duplication in Endpoints.scala

* Apply review suggestion

* Update test name to reflect field name changes

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/Endpoints.scala

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-06-16 07:55:50 +00:00