我尝试从普罗米修斯获取这些测量值:
increase(http_server_requests_seconds_count{uri="myURI"}[10s])
increase(http_server_requests_seconds_count{uri="myURI"}[30s])
rate(http_server_requests_seconds_count{uri="myURI"}[10s])
rate(http_server_requests_seconds_count{uri="myURI"}[30s])
然后我运行一个 python 脚本,其中创建了 5 个线程,每个线程都访问此 myURI 端点:
我在 Grafana 上看到的是:
我收到了这些值:
我预计会收到这些(但没有):
有人可以用我的例子解释这个函数背后的公式以及实现我期望的指标/值的方法吗?
我看到eclipse在我的用户主文件夹中创建了一些文件夹,如.eclipse .p2等...我想更改此默认文件夹(我想将所有文件保存在D:位置。)。我在Linux中阅读了这个Change .eclipse文件夹,但是我不知道我必须更改哪个文件.ini,如果在安装Eclipse之后进行此操作,我是否还要更改。此外,我有Windows 10而不是Linux。对不起我的英语不好。希望能对您有所帮助。
这是我的eclipse.ini
-data
D:/Programmi/Eclipse
-configuration
D:/Programmi/Eclipse/eclipse `
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.550.v20170928-1359
-product
org.eclipse.epp.package.java.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-D"user.home=D:/Programmi/Eclipse/home"
-Dosgi.requiredJavaVersion=1.8
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m
--add-modules=ALL-SYSTEM
Run Code Online (Sandbox Code Playgroud) 简而言之,在 Java 的 LTS 版本 (Java 17) 中,我们第一次有了关键字sealed
,它使我们能够限制层次结构:
public abstract sealed class Person
permits Employee, Manager {
//...
}
Run Code Online (Sandbox Code Playgroud)
如果我想创建一个扩展基类的新子类Person
,我也必须修改基类。这是否违反开闭原则?
当我运行命令时出现以下错误mvn clean install
:
[ERROR] /Users/xxx/xxx/xxx/xxx.xxx/target/generated-sources/kapt/compile/com/xxx/xxx/xxx/xxx/DataMapperImpl.java:[10,40] cannot find symbol
[ERROR] symbol: class DataMapperDecorator
[ERROR] /Users/xxx/xxx/xxx/xxx.xxx/target/generated-sources/kapt/compile/com/xxx/xxx/xxx/xxx/DataMapperImpl.java:[10,74] cannot find symbol
[ERROR] symbol: class DataMapper
[ERROR] /Users/xxx/xxx/xxx/xxx.xxx/xxx/generated-sources/kapt/compile/com/xxx/xxx/xxx/api/DataMapperImpl.java:[12,19] cannot find symbol
[ERROR] symbol: class DataMapper
[ERROR] location: class com.xxx.xxx.xxx.xxx.DataMapperImpl
Run Code Online (Sandbox Code Playgroud)
似乎在 mapstruct 生成DataMapperImpl.java
类后,它无法找到类DataMapper
和DataMapperDecoretor
。
与mapstruct相关的代码在一个xxx.kt
文件中:
//Other stuff
...
@Mapper
@DecoratedWith(DataMapperDecorator::class)
interface DataMapper {
@Mappings(
Mapping(source = "data.value", target = "dataValue"),
Mapping(source = "data.current.value", target = "currentValue"),
)
fun toDto(data: Data) : RefDataDto
}
abstract class DataMapperDecorator : …
Run Code Online (Sandbox Code Playgroud) 我使用经典命令安装了 postgresql 10:
酿造安装postgresql@10
然后我启动了服务:
酿造服务启动 postgresql@10
输出显示:
成功启动postgresql@10(标签:homebrew.mxcl.postgresql@10)
但是当我运行这个命令时:
酿造服务
这就是我得到的:
Name Status User Plist
cassandra stopped
postgresql stopped
postgresql@10 error username /opt/homebrew/opt/postgresql@10/homebrew.mxcl.postgresql@10.plist
Run Code Online (Sandbox Code Playgroud)
该服务似乎未正确运行。之前我有另一个版本的 Posgresql。又是版本 10,但使用提供的安装程序安装,但使用了 postgresql 的网页。不过我应该把它删除了。
我使用此命令检查已使用的端口:
lsof -nP +c 15 | grep LISTEN
Run Code Online (Sandbox Code Playgroud)
我没有使用端口 5432(postgresql 使用的默认端口)的服务。
eclipse ×1
grafana ×1
homebrew ×1
install ×1
java-17 ×1
kotlin ×1
macos ×1
mapstruct ×1
maven ×1
micrometer ×1
postgresql ×1
prometheus ×1
sealed-class ×1
spring ×1
windows ×1