Browse Source

Update TreeFrog Framework to version 2.6 (#7835)

* updated to version 2.1.

* renamed

* updated benchmark_config.json

* updated treefrog to v2.6.0

* updated

* updated
TreeFrog Framework 2 years ago
parent
commit
a62c26efdd

+ 43 - 11
frameworks/C++/treefrog/config/application.ini

@@ -34,12 +34,18 @@ UploadTemporaryDirectory=tmp
 # Specify setting files for SQL databases.
 # Specify setting files for SQL databases.
 SqlDatabaseSettingsFiles=database.ini
 SqlDatabaseSettingsFiles=database.ini
 
 
-# Specify the setting file for MongoDB, mongodb.ini.
+# Specify the setting file for MongoDB.
+# To access MongoDB server, uncomment the following line.
 MongoDbSettingsFile=mongodb.ini
 MongoDbSettingsFile=mongodb.ini
 
 
-# Specify the setting file for Redis, redis.ini.
+# Specify the setting file for Redis.
+# To access Redis server, uncomment the following line.
 RedisSettingsFile=
 RedisSettingsFile=
 
 
+# Specify the setting file for Memcached.
+# To access Memcached server, uncomment the following line.
+MemcachedSettingsFile=
+
 # Specify the directory path to store SQL query files.
 # Specify the directory path to store SQL query files.
 SqlQueriesStoredDirectory=sql/
 SqlQueriesStoredDirectory=sql/
 
 
@@ -51,7 +57,24 @@ DirectViewRenderMode=false
 # Specify a file path for SQL query log.
 # Specify a file path for SQL query log.
 # If it's empty or the line is commented out, output to SQL query log
 # If it's empty or the line is commented out, output to SQL query log
 # is disabled.
 # is disabled.
-SqlQueryLogFile=
+SqlQueryLog.FilePath=
+
+# Specify the layout of SQL query log.
+#  %d : date-time
+#  %p : priority (lowercase)
+#  %P : priority (uppercase)
+#  %t : thread ID (dec)
+#  %T : thread ID (hex)
+#  %i : PID (dec)
+#  %I : PID (hex)
+#  %e : elapsed processing time in milliseconds
+#  %m : log message
+#  %n : newline code
+SqlQueryLog.Layout="%d [%t] (%e) %m%n"
+
+# Specify the date-time format of SQL query log, see also QDateTime
+# class reference.
+SqlQueryLog.DateTimeFormat="yyyy-MM-dd hh:mm:ss"
 
 
 # Determines whether the application aborts (to create a core dump
 # Determines whether the application aborts (to create a core dump
 # on Unix systems) or not when it output a fatal message by tFatal()
 # on Unix systems) or not when it output a fatal message by tFatal()
@@ -95,6 +118,7 @@ Session.Name=TFSESSION
 # For 'sqlobject', the settings specified in SqlDatabaseSettingsFiles are used.
 # For 'sqlobject', the settings specified in SqlDatabaseSettingsFiles are used.
 # For 'mongodb', the settings specified in MongoDbSettingsFile are used.
 # For 'mongodb', the settings specified in MongoDbSettingsFile are used.
 # For 'redis', the settings specified in RedisSettingsFile are used.
 # For 'redis', the settings specified in RedisSettingsFile are used.
+# For 'memcached', the settings specified in MemcachedSettingsFile are used.
 Session.StoreType=cookie
 Session.StoreType=cookie
 
 
 # Replaces the session ID with a new one each time one connects, and
 # Replaces the session ID with a new one each time one connects, and
@@ -111,6 +135,10 @@ Session.CookieDomain=
 # Specifies a path attribute to set in the session cookie. Defaults to /.
 # Specifies a path attribute to set in the session cookie. Defaults to /.
 Session.CookiePath=/
 Session.CookiePath=/
 
 
+# Specifies a value to assert that a cookie must not be sent with cross-origin
+# requests; Strict, Lax or None.
+Session.CookieSameSite=Lax
+
 # Probability that the garbage collection starts.
 # Probability that the garbage collection starts.
 # If 100 specified, the GC of sessions starts at the rate of once per 100
 # If 100 specified, the GC of sessions starts at the rate of once per 100
 # accesses. If 0 specified, the GC never starts.
 # accesses. If 0 specified, the GC never starts.
@@ -182,6 +210,7 @@ AccessLog.FilePath=
 #  %r : First line of request
 #  %r : First line of request
 #  %s : Status code
 #  %s : Status code
 #  %O : Bytes sent, including headers, cannot be zero
 #  %O : Bytes sent, including headers, cannot be zero
+#  %e : elapsed processing time in milliseconds
 #  %n : Newline code
 #  %n : Newline code
 AccessLog.Layout="%h %d \"%r\" %s %O%n"
 AccessLog.Layout="%h %d \"%r\" %s %O%n"
 
 
@@ -210,13 +239,13 @@ ActionMailer.smtp.HostName=
 # Specify the connection's port number.
 # Specify the connection's port number.
 ActionMailer.smtp.Port=
 ActionMailer.smtp.Port=
 
 
-# Enables STARTTLS extension if true.
-ActionMailer.smtp.EnableSTARTTLS=false
-
 # Enables SMTP authentication if true; disables SMTP
 # Enables SMTP authentication if true; disables SMTP
 # authentication if false.
 # authentication if false.
 ActionMailer.smtp.Authentication=false
 ActionMailer.smtp.Authentication=false
 
 
+# Enables STARTTLS extension if true.
+ActionMailer.smtp.EnableSTARTTLS=false
+
 # Specify the user name for SMTP authentication.
 # Specify the user name for SMTP authentication.
 ActionMailer.smtp.UserName=
 ActionMailer.smtp.UserName=
 
 
@@ -237,16 +266,19 @@ ActionMailer.smtp.DelayedDelivery=false
 ## Cache section
 ## Cache section
 ##
 ##
 
 
-# Specify the settings file to enable the cache module.
-# Comment out the following line.
+# Specify the settings file to enable the cache module,
+# which can be used through Tf::cache() function.
+# See https://api-reference.treefrogframework.org/classTCache.html.
+# Uncomment the following line and write connection information
+# to the file.
 Cache.SettingsFile=cache.ini
 Cache.SettingsFile=cache.ini
 
 
-# Specify the cache backend, such as 'sqlite', 'mongodb', 'redis' or
-# 'memory'.
+# Specify the cache backend, such as 'sqlite', 'mongodb', 'redis',
+# 'memcached' or 'memory'.
 Cache.Backend=memory
 Cache.Backend=memory
 
 
 # Probability of starting garbage collection (GC) for cache.
 # Probability of starting garbage collection (GC) for cache.
-# If 100 is specified, GC will be started at a rate of once per 100
+# If 1000 is specified, GC will be started at a rate of once per 1000
 # sets. If 0 is specified, the GC never starts.
 # sets. If 0 is specified, the GC never starts.
 Cache.GcProbability=100000000
 Cache.GcProbability=100000000
 
 

+ 10 - 0
frameworks/C++/treefrog/config/cache.ini

@@ -28,3 +28,13 @@ UserName=
 Password=
 Password=
 ConnectOptions=
 ConnectOptions=
 PostOpenStatements=
 PostOpenStatements=
+
+[memory]
+DatabaseName=tfcache.shm
+HostName=
+Port=
+UserName=
+Password=
+ConnectOptions=MEMORY_SIZE=1G
+PostOpenStatements=
+

+ 1 - 1
frameworks/C++/treefrog/controllers/worldcontroller.cpp

@@ -220,7 +220,7 @@ void WorldController::cached_pqueries()
 
 
 void WorldController::cached_pqueries(const QString &num)
 void WorldController::cached_pqueries(const QString &num)
 {
 {
-    constexpr int SECONDS = 60 * 10;  // cache time
+    constexpr int SECONDS = 60 * 30;  // cache time
     QVariantList worlds;
     QVariantList worlds;
     QVariantMap world;
     QVariantMap world;
     int d = std::min(std::max(num.toInt(), 1), 500);
     int d = std::min(std::max(num.toInt(), 1), 500);

+ 2 - 2
frameworks/C++/treefrog/treefrog-epoll.dockerfile

@@ -2,13 +2,13 @@ FROM buildpack-deps:jammy
 
 
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
 ENV DEBCONF_NOWARNINGS yes
-ENV TFVER=2.5.0
+ENV TFVER=2.6.0
 
 
 RUN apt-get update -yqq && apt-get upgrade -yq && \
 RUN apt-get update -yqq && apt-get upgrade -yq && \
     apt-get install -yqq --no-install-recommends software-properties-common unzip wget libjemalloc-dev \
     apt-get install -yqq --no-install-recommends software-properties-common unzip wget libjemalloc-dev \
     qmake6 qt6-base-dev qt6-base-dev-tools qt6-tools-dev-tools qt6-declarative-dev libqt6sql6-mysql \
     qmake6 qt6-base-dev qt6-base-dev-tools qt6-tools-dev-tools qt6-declarative-dev libqt6sql6-mysql \
     libqt6sql6-psql libqt6sql6-odbc libqt6sql6-sqlite libqt6core6 libqt6qml6 libqt6xml6 libpq5 libodbc1 \
     libqt6sql6-psql libqt6sql6-odbc libqt6sql6-sqlite libqt6core6 libqt6qml6 libqt6xml6 libpq5 libodbc1 \
-    libmongoc-dev libbson-dev gcc g++ clang make cmake pkg-config redis-server
+    libmongoc-dev libbson-dev gcc g++ clang make cmake pkg-config
 RUN rm -f /usr/bin/qmake; ln -sf /usr/bin/qmake6 /usr/bin/qmake
 RUN rm -f /usr/bin/qmake; ln -sf /usr/bin/qmake6 /usr/bin/qmake
 
 
 WORKDIR /usr/src
 WORKDIR /usr/src

+ 2 - 2
frameworks/C++/treefrog/treefrog-mongodb.dockerfile

@@ -2,13 +2,13 @@ FROM buildpack-deps:jammy
 
 
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
 ENV DEBCONF_NOWARNINGS yes
-ENV TFVER=2.5.0
+ENV TFVER=2.6.0
 
 
 RUN apt-get update -yqq && apt-get upgrade -yq && \
 RUN apt-get update -yqq && apt-get upgrade -yq && \
     apt-get install -yqq --no-install-recommends software-properties-common unzip wget libjemalloc-dev \
     apt-get install -yqq --no-install-recommends software-properties-common unzip wget libjemalloc-dev \
     qmake6 qt6-base-dev qt6-base-dev-tools qt6-tools-dev-tools qt6-declarative-dev libqt6sql6-mysql \
     qmake6 qt6-base-dev qt6-base-dev-tools qt6-tools-dev-tools qt6-declarative-dev libqt6sql6-mysql \
     libqt6sql6-psql libqt6sql6-odbc libqt6sql6-sqlite libqt6core6 libqt6qml6 libqt6xml6 libpq5 libodbc1 \
     libqt6sql6-psql libqt6sql6-odbc libqt6sql6-sqlite libqt6core6 libqt6qml6 libqt6xml6 libpq5 libodbc1 \
-    libmongoc-dev libbson-dev gcc g++ clang make cmake pkg-config redis-server
+    libmongoc-dev libbson-dev gcc g++ clang make cmake pkg-config
 RUN rm -f /usr/bin/qmake; ln -sf /usr/bin/qmake6 /usr/bin/qmake
 RUN rm -f /usr/bin/qmake; ln -sf /usr/bin/qmake6 /usr/bin/qmake
 
 
 WORKDIR /usr/src
 WORKDIR /usr/src

+ 2 - 2
frameworks/C++/treefrog/treefrog-mysql.dockerfile

@@ -2,13 +2,13 @@ FROM buildpack-deps:jammy
 
 
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
 ENV DEBCONF_NOWARNINGS yes
-ENV TFVER=2.5.0
+ENV TFVER=2.6.0
 
 
 RUN apt-get update -yqq && apt-get upgrade -yq && \
 RUN apt-get update -yqq && apt-get upgrade -yq && \
     apt-get install -yqq --no-install-recommends software-properties-common unzip wget libjemalloc-dev \
     apt-get install -yqq --no-install-recommends software-properties-common unzip wget libjemalloc-dev \
     qmake6 qt6-base-dev qt6-base-dev-tools qt6-tools-dev-tools qt6-declarative-dev libqt6sql6-mysql \
     qmake6 qt6-base-dev qt6-base-dev-tools qt6-tools-dev-tools qt6-declarative-dev libqt6sql6-mysql \
     libqt6sql6-psql libqt6sql6-odbc libqt6sql6-sqlite libqt6core6 libqt6qml6 libqt6xml6 libpq5 libodbc1 \
     libqt6sql6-psql libqt6sql6-odbc libqt6sql6-sqlite libqt6core6 libqt6qml6 libqt6xml6 libpq5 libodbc1 \
-    libmongoc-dev libbson-dev gcc g++ clang make cmake pkg-config redis-server
+    libmongoc-dev libbson-dev gcc g++ clang make cmake pkg-config
 RUN rm -f /usr/bin/qmake; ln -sf /usr/bin/qmake6 /usr/bin/qmake
 RUN rm -f /usr/bin/qmake; ln -sf /usr/bin/qmake6 /usr/bin/qmake
 
 
 WORKDIR /usr/src
 WORKDIR /usr/src

+ 2 - 2
frameworks/C++/treefrog/treefrog.dockerfile

@@ -2,13 +2,13 @@ FROM buildpack-deps:jammy
 
 
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
 ENV DEBCONF_NOWARNINGS yes
-ENV TFVER=2.5.0
+ENV TFVER=2.6.0
 
 
 RUN apt-get update -yqq && apt-get upgrade -yq && \
 RUN apt-get update -yqq && apt-get upgrade -yq && \
     apt-get install -yqq --no-install-recommends software-properties-common unzip wget libjemalloc-dev \
     apt-get install -yqq --no-install-recommends software-properties-common unzip wget libjemalloc-dev \
     qmake6 qt6-base-dev qt6-base-dev-tools qt6-tools-dev-tools qt6-declarative-dev libqt6sql6-mysql \
     qmake6 qt6-base-dev qt6-base-dev-tools qt6-tools-dev-tools qt6-declarative-dev libqt6sql6-mysql \
     libqt6sql6-psql libqt6sql6-odbc libqt6sql6-sqlite libqt6core6 libqt6qml6 libqt6xml6 libpq5 libodbc1 \
     libqt6sql6-psql libqt6sql6-odbc libqt6sql6-sqlite libqt6core6 libqt6qml6 libqt6xml6 libpq5 libodbc1 \
-    libmongoc-dev libbson-dev gcc g++ clang make cmake pkg-config redis-server
+    libmongoc-dev libbson-dev gcc g++ clang make cmake pkg-config
 RUN rm -f /usr/bin/qmake; ln -sf /usr/bin/qmake6 /usr/bin/qmake
 RUN rm -f /usr/bin/qmake; ln -sf /usr/bin/qmake6 /usr/bin/qmake
 
 
 WORKDIR /usr/src
 WORKDIR /usr/src